How come select says there is data, but read returns zero?
Answer / chaitanya
The data that causes select to return is the EOF because the other side has closed the connection. This causes read to return zero.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why do I get EPROTO from read()?
What is a socket file?
Why does connect() succeed even before my server did an accept()?
If bind() fails, what should I do with the socket descriptor?
What is socket address?
Are unix sockets faster than tcp?
Where can a get a library for programming sockets?
How to find other end of unix socket connection?
Can a socket have multiple ports?
What does af mean in sockets?
Is there any advantage to handling the signal, rather than just ignoring it and checking for the EPIPE error? Are there any useful parameters passed to the signal catching function?
Where is the socket located?