I am very sorry if my question is a duplicate, but I did not find useful information on the site.
I use non-blocking sockets and select (). How can I determine if a client has closed a connection on a non-blocking socket? I have seen that read () returns -1 with errno = EWOULDBLOCK when there is no data to read and also when the connection is closed.
How can I distinguish the above cases?
source
share