How to properly disable socket (Linux)

Source: Internet
Author: User

I have encountered several problems, which are related to the failure to completely close the socket on the client or server. InCodeThis type of problem can be seen everywhere, but it is not easy to expose bugs.

For a half-closed socket, the first side is fin_wait2 and the other side is wait_close.

There are some concise articles on the InternetArticleFor reference.

Reference Links:

"Why does the socket send () or return success if the remote connection has been closed ?" .

"Socket. Send () succeeds, but remote end point closed the connection"

Http://bytes.com/topic/c-sharp/answers/501034-socket-send-succeeds-but-remote-end-point-closed-connection

Msdn article: normal shutdown, linger options, and socket Shutdown

"Graceful shutdown, linger options, and socket Closure"

Http://msdn.microsoft.com/en-us/library/ms738547

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.