Application Crashes after running for several days

deejross

Member
Joined
May 10, 2006
Messages
8
Programming Experience
3-5
Hello Everyone,

I have written a client/server application in vb.net 2005. It has been in development for 6 months now and I keep having a problem with the server application. It is running on a Windows 2003 server with all the latest updates. The server app runs between 3 to 7 days just fine, then all the sudden, any clients connected to it freeze, and any new clients will also freeze. The server was a console app for most of the development, but I recently moved it over to a windows service. Once I did that, I waited for it to crash again, and check the event log. This is what it said:

EventType clr20r3, P1 tdoccserver.exe, P2 1.0.0.28, P3 451161fe, P4 tdoccserver, P5 1.0.0.28, P6 451161fe, P7 dd, P8 87, P9 system.net.sockets.socket, P10 NIL

I was confused for a long time because, as I said, it would run fine, then just freeze all socket connections. The console application was responsive and worked fine. I would have to restart the server application for the clients to be able to connect. All through the development, I would get this problem, thinking there was an exception firing somewhere, so I put a Try Catch on every procedure that logs the exception to a text file. It doesn't write anything to the file when it freezes, it just quits working.

To give you a little background info, it uses the Sockets namespace to transfer text commands between the client and server. It also opens up a second port for binary data (files). The server app can be described as similar to an FTP server.

Does anyone have any ideas?

Thanks in advance for your help.
 
Can you run it in debug mode (put Visual Studio on the server) and when it is frozen, press pause and see what the currently executing method is? Is it multi threaded? Have you taken steps to avoid deadlock?
 
I cannot install Visual Studio on the server, so I won't be able to test that, but I do remember it happening when I left it debugging overnight, but it didn't stop at any procedure when I hit pause, it gave me the message that there is no source code to view, or whatever it says. So it wasn't deadlock. It uses multithreading, but only for background tasks. All the open sockets are on the same thread. Should I have each socket create a new thread?
 
Back
Top