I have created a Client/Server application with the IdTCPServer component. The clients connect and maintain a persistent connection through the life of the application. If the network connection is dropped (which happens quite frequently because clients connect with wireless aircards) the client will automatically re-connect. This all works fine.
My problem is dealing with the sockets on the server corresponding to the lost connection. They don't detect the network drop and disconnect themselves. After reading several related articles, I have learned there is no way for the server to know if a connection was dropped. It must wait for some event to find this out.
So my question is, should I build some mechanism into my server to periodically "handle" the sockets with dropped connections? And if so, how? I thought one way would be do cycle through all connections and attempt to send them data. I find this will trigger that needed "event".