How should I check a (TCP) socket to find out whether it is connected?
I have read about the Socket.Connected property in MSDN, but it says it only show
Typically one would use the Socket.Select method to determine the state of a set of sockets (Socket.Poll for a single socket).
Both of these methods allow you to query a socket's state. Now, assuming that you have tracked that the socket connected in the first place then you would typically call Select/Poll on the socket before attempting a read. If Select/Poll indicate that the socket is readable this tells you that:
Personally I've never used Poll - I've always used Select but MSDN seems to suggest that Poll is pretty much the same as Select but for single sockets.
I'll also add that in most cases using Select is the most efficient and best way of handling Socket connections.