Recently using Winsock to do a network project, the use of 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.
the 10054 Error :wsaeconnreset on MSDN is checked ( 10054 )
Connection reset by peer.
&NBSP ;
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 host are rebooted, or The remote host used a "hard close" (= 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 is generated 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.