PiggyBank1974 Posted December 1, 2008 Posted December 1, 2008 At work we use External USB Modem for the users that are reporting on site, as there is no permanent internet facility available. I�ve been working on a chat program to link all users together, both the Server and Client are working fine over the internet, but I�ve hit a snag and I�m not to sure how to go about fixing it. If a user closes the program data arrives to the server which is Zero in length this signifies to the server that the user has disconnected and all other users that are connected are informed of this. The problem I�ve got is if the connection goes down (on a datacard it can quite often depending on signal strength) or the datacard is disconnected, a signal does not get sent to the Server about the disconnection, this means that: A: The socket is unavailable to use again as the server is still saying that it�s in use. B: No other user gets informed of the disconnected user not been available. Can anybody think of a way around this problem?? Quote
Administrators PlausiblyDamp Posted December 1, 2008 Administrators Posted December 1, 2008 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 hasn't actually had any real information to transmit. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
MrPaul Posted December 2, 2008 Posted December 2, 2008 Ping 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. Good luck :cool: Quote Never trouble another for what you can do for yourself.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.