Could the server track how long it is since a particular client sent anything and if it is past a particular threshold have the server close the port.
The client could periodically send a dummy request to the server to keep the connection alive if it hasnt actually had any real information to transmit.
If the server periodically sends a "ping" style message to the client, eventually network failures will be detected by the underlying transport protocols and then get propagated back to your server application to handle appropriately.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.