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
)
An EchoResult object describing the Ping response received.
Exception | Description |
---|---|
SocketException | The remote address is unknown, invalid, or unable to be resolved. |
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.
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");
}
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Ping Class | Ping Members | Overload List
Send comments on this topic.
Documentation version 1.1.2.0.
© 2008 Dart Communications. All rights reserved.