Alistair George wrote:

Thanks to Conner for suggesting Ping which works, but the specs (I just found)
require that the clients program interrogates the commanders program to
determine if both programs are running and connected to the net.

You can try a blind connection from client to server, but that can take a long time to timeout if the server is unavailable. Slightly faster is to fire a UDP packet to a port on the server machine and do nothing until a reply is received. That proves the availability of the server, and you can then get to the messy business of making a TCP connection.


UDP is, however, unreliable. This means that failing to receive a response doesn't guarantee that the server isn't available. Either the request packet or the response packet may have simply been eaten by the network.

You might be better served by an asynchronous connection. The various WSAAsync API functions are a place to start, or you could try a component set that encapsulates them. I'd suggest ICS (as opposed to Indy or the bundled TCP components).

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to