Hi Rick!
I was working with this problem more than one year. At my job we were migrating some GSM staff to TCP/IP network. And finally we concluded that the bestest way to monitor the connection is to send "heartbeats" each other. Heartbeat is just 2 bytes message: 1st byte is header ("I am heartbeat") and second any value you agreed in you connection protocol.
Server sends to client, client sends to server. Lets say once per 2-5 minutes.
You should have timeout timer. If heartbeat doesn't in 5 minutes you are writting it and after n times of absence of heartbeats you closes connection (the threshold for quantity of missing heartbeats (3-10)).
This was the bestest way to be sure that servers are working and connection still alive. Because we met situation when server hanging in some state and keeps connection open but doesn't work and client thinks it is Ok. But is not.
Here the values for heartbeat (every 2-5 minutes) and threshhold for missing hearbeats 3-10 are taken from real life.
I hope I described this clear and it will help you (ask if ...)
alex from JavaFaq
http://www.erudite-center.com/java