When using select() (or epoll), errors are indicated by flagging the socket readable, then the recv() call will fail and indicates the error.
After the peer has closed the collection and recv has returned 0, will the socket continue to be flagged readable when an error occurs? When that happens can I continue to use recv() to get that error?
One scenario when something like this can happen is when a HTTP client sends a request, then shuts down the socket, but instead of waiting for the response, it sends RST and leaves. So the server should have a way to detect this and abort all processing for this client.