See Also

Ping Class  | Ping Members  | Overload List

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

remoteHost
A host name or dot address representing the remote host to Ping.
See Also Languages PowerTCP SSL Sockets for .NET

Send(String) Method

Dart.PowerTCP.SslSockets Namespace > Ping Class > Send Method : Send(String) Method

Determine if a host is reachable.

[Visual Basic]
Overloads Public Function Send( _    ByVal remoteHost As String _ ) As EchoResult
[C#]
public EchoResult Send(    string remoteHost );
[C++]
public: EchoResult* Send(    string* remoteHost )
[C++/CLI]
public: EchoResult^ Send(    String^ remoteHost )

Parameters

remoteHost
A host name or dot address representing the remote host to Ping.

Return Type

An EchoResult object describing the Ping response received.

Exceptions

ExceptionDescription
SocketExceptionThe remote address is unknown, invalid, or unable to be resolved.

Remarks

This method pings the host specified by remoteHost with default settings (TTL = 128, data = 32 occurrences of "&"). An EchoResult object is returned from the method. Check the properties of the EchoResult for data about the Ping operation. For example, ResponseTime returns the amount of time for the response to be received.

Example

The following example demonstrates a default ping operation.

[Visual Basic] 

Try
   ' Ping a host
   Dim er As EchoResult = Ping1.Send("www.dart.com")

   ' Display results
   Debug.WriteLine("Response from www.dart.com")
   Debug.WriteLine("Sequence number " + er.Sequence)
   Debug.WriteLine("Delay " + er.ResponseTime)
   Debug.WriteLine("Bytes " + er.Data.Length)

Catch ex as Exception
    Debug.WriteLine("Cannot reach www.dart.com")
End Try

[C#] 


try
{
  
// Ping a host
  
EchoResult er = ping1.Send("www.dart.com");

  
// Display results
  
Debug.WriteLine("Response from www.dart.com");
  Debug.WriteLine(
"Sequence number " + er.Sequence);
  Debug.WriteLine(
"Delay " + er.ResponseTime);
  Debug.WriteLine(
"Bytes " + er.Data.Length);
}
catch(Exception ex)
{
  Debug.WriteLine(
"Cannot reach www.dart.com");
}
                

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Ping Class  | Ping Members  | Overload List


Send comments on this topic.

Documentation version 1.1.2.0.

© 2008 Dart Communications.  All rights reserved.