Socket (client) crashes program one one computer when the other computer (server) powers down - Strange
-
Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man
-
Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man
Stan the man wrote:
Is there something that I need to do
The first thing I would do is to try some debugging to find out what is causing the crash; and what sort of crash it is. Is it a bug in the client code, something in the system libraries etc? Without that information it's not easy to suggest how to fix it.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man
-
Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man
How long does it take to crash? As a wild guess...something to do with Active Directory and DNS resolution. Of the scenarios you listed I would suspect that on shutdown AD is told about the server shutdown. Where in the other cases AD doesn't know about it. Consequently AD fails for the one case where in the others connectivity failures are the result.
Stan the man wrote:
the client program will crash when trying to connect (it will try to connect to a server every 3 seconds)
That is a very small retry window. Presumably you are correctly cleaning up after each of those attempts.
-
Hi Everyone. Not sure if anyone met this situation. I have a program (client) sitting one one computer (WinXP) and a server sitting on another computer (win7). My programs works fine and will not crash when the ethernet cable is pulled out, when the server program is shutdown etc. BUT when the server computer turns off, the client program will crash when trying to connect (it will try to connect to a server every 3 seconds). If the computer is on and even if the server program is not running, the client is fine and will just continue to connect. Not sure what is happening when a computer is off but the ethernet cable is still plugged in. Has anyone seen this kind of thing? Is there something that I need to do or check for in the client that will prevent this crashing from occurring? THanks ! Stan the man
For debug purposes... did you try to extend the retry (longer than 3 seconds)? Did you make sure the last attempt was finished, failed, and was cleaned up before you attempted to connect again? 3 seconds may not be enough time for the initial attempt to timeout... something to consider.