Linux-non-blocking socket programming handles Eagain errors

Source: Internet
Author: User
The resource temporarily Unavailable,errno code is often present in Linux for non-blocking socket receive data (Eagain), which indicates that you are using blocking operation in nonblocking mode. This error is returned when the operation is not completed, and the error does not break the socket synchronization, and the next loop will be recv. For non-blocking sockets, Eagain is not an error. On VxWorks and Windows, Eagain is named Ewouldblock.

Additionally, if EINTR is present as errno 4, the error description interrupted system call, the operation should also continue.

Finally, if the return value of recv is 0, it indicates that the connection has been disconnected and our receive operation should end.

Linux-non-blocking socket programming handles Eagain errors

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.