When developing our networking protocol on the dogs, I couldn't figure
out why things were not connecting. I finally narrowed it down to the
simple problem of the TCP/IP stack timing out because the port at the
other end wasn't open or was not responding quickly enough. So, I
developed this helper function to let the programmer know when the
TCP/IP stack has failed in a bad state, i.e. timeouts, ports closed,
handshaking failed, etc... The isConnected function only allows you to
check whether or not you have successfully connected, but there is no
way of determining whether the connection failed at the TCP/IP level.
This simple function allows you to check and retry your connect if it
failed.
Chris
--
Chris Mansley
Research Assistant
VADER Lab
Lehigh University