I have an application that uses sockets to connect to my server. A lot of times the application lies "dormant" when it doesn't need to send info back and forth to the server. When that happens, occasionally it will disconnect.
How can I determine when the socket has disconnected and then try to re-establish a connection?
I've used some applications that do exactly this and will pop up a dialog box that indicates "reconnecting". I'm sure I could code this in with some kind of "ping" method that fires every X number of seconds, but I'm wondering if the socket class has something built in that these other apps are using?