Crashes
-
Hi all. I have a TCP program that crashes when a connection isnt made. One example is when i open it and dont allow the connection through a firewall it crashes in Windows. How would i go about making it try to reconnect every so often if a connection isnt established without crashing? Thanx in advance!
-
Hi all. I have a TCP program that crashes when a connection isnt made. One example is when i open it and dont allow the connection through a firewall it crashes in Windows. How would i go about making it try to reconnect every so often if a connection isnt established without crashing? Thanx in advance!
dellthinker wrote:
How would i go about making it try to reconnect every so often if a connection isnt established without crashing?
Probably the first step is to use the debugger to determine exactly why it is crashing. When it crashes, look at the call stack window, see how it got there, inspect the variables.
Best wishes, Hans
[CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]
-
dellthinker wrote:
How would i go about making it try to reconnect every so often if a connection isnt established without crashing?
Probably the first step is to use the debugger to determine exactly why it is crashing. When it crashes, look at the call stack window, see how it got there, inspect the variables.
Best wishes, Hans
[CodeProject Forum Guidelines] [How To Ask A Question] [My Articles]
I ran the debugger and it pointed at this line:
structSock.sin_addr.s_addr = *((unsigned long*)ServerAddr->h_addr_list[0]);
Do i need to loop this every so often to make sure the program doesnt crash when trying to connect? This was the error message that VC++ gave me. Unhandled exception in Program.exe: 0xC0000005: Access Violation. P.S. I set a breakpoint at that line and yes it is the problem. How can i resolve this? Anyone care to shed some light on what that means?