The problem of recv return value in non-blocking state

In the non-blocking state of the

recv function, no data is returned with a value of 0. If the client shuts down, the return value is also 0. How can the two states be distinguished?

Mar.23,2021

default recv should be blocked. When setting MSG_DONTWAIT or socket descriptor with O_NONBLOCK option, in the absence of data, should return-1 and set errno to EAGAIN or EWOULDBLOCK


non-blocking mode, no data return value is-1, and the error code is EAGAIN or EWOULDBLOCK.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3806d-2c0f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3806d-2c0f4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?