error#10054 errors in the socket program

Source: Internet
Author: User
Tags connection reset

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.

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.