Recently using Winsock to do a network project, using the Tcp+socket connection to write a multithreaded network program, the function is the client is responsible for constantly sending data to the server side, the service side is responsible for receiving data. The client is a DLL, and the server-side program is a randomly initiated NT Service service program.
Program at night unmanned operation of the process, the client often irregular error number is: 10054 error, and the server side does not have the corresponding prompts. The operating environment is WIN2000+SP4, the problem appears to be more puzzling.
Check out the 10054 error number on MSDN Description: Wsaeconnreset (10054)
Connection reset by Peer.
A existing connection is forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the Ho St is rebooted, or the remote host used a "Hard close" (Click setsockopt for more information On the So_linger option on the remote socket.
In other words, a connection is reset by the other. An established connection is forcibly shut down by a remote host, and a 10054 error occurs if the process on the remote host terminates abnormally (due to a memory conflict or hardware failure), or if a forced shutdown is performed against the socket. For forced shutdown situations, you can configure a socket using the SO_LINGER socket option and the setsockopt.
But in the end of my program is because of what causes the connection is reset, it is not very clear, this also needs to further check debugging to solve this problem.