Ping

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloConnection > TApolloConnection Methods >

Ping

Declaration

function Ping: Boolean;

Description

Ping takes no parameters. The TCP/IP connection is tested and, if the connection to the IP address (or domain name) and Port address can be resolved, returns True. Otherwise, returns False and also forces Active property to False. Ping may take a second or two to return, especially when there is no connection found. So, this method should not generally be called within a tight loop, and should only be used in cases where it is critical to determine the current connection status at the possible expense of some performance.

Delphi Example

if ApolloConnection1.Ping then

 ShowMessage( 'Connection OK' ) 

else

 ShowMessage( 'Connection FAILED' ); 

See Also

Connected, Host, Port