error#10054 errors in the socket program

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.