How come select says there is data, but read returns zero?
Answer Posted / 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 |
Post New Answer View All Answers
Why do we need sockets?
What are the pros/cons of select(), non-blocking I/O and SIGIO?
What's the difference between a socket and a port?
Why does the sockets buffer fill up sooner than expected?
What is a socket set used for?
What's the difference between impact sockets and regular sockets?
How is a socket created?
Why do I get EPROTO from read()?
How can I force a socket to send the data in its buffer?
What pieces of information make up a socket?
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?
What is difference between socket and websocket?
How do I convert a string into an internet address?
What is the difference between SO_REUSEADDR and SO_REUSEPORT?
How to find other end of unix socket connection?