04-15-2011 06:11 PM
In a tcp server-client connection, for example like the TCP Communicator - Passive/Active examples, I'm noticing that if one of the server reboots, the client (active in the examples) never notices. The read function never returns an error 66, it goes about it's life with the normal time out error 56, and waits forever for a message from the server.
I wanted to get some suggestions on if there's a good way to detect this dropped connection. Ideally, I'd want to do this with a client only fix.
One idea: Make the server send messages even if it has nothing to say. If the client sees the server go dark for too long, it disconnects. I don't particularly like this solution because it requires a watch dog of a sort on the client and that seems inelegant. It also requires a dummy process on the server to keep sending otherwise useless messages.
04-15-2011 11:37 PM
04-17-2011 01:24 AM
Data flows more often from server to client but neither are at regular intervals. It could be 30 minutes between updates from the server.