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


Please Help Members By Posting Answers For Below Questions

How many socket connections can a server handle?

474


Is tcp or unix socket faster?

496


system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?

1165


How do unix sockets work?

492


Why does the sockets buffer fill up sooner than expected?

997






How is a socket created?

511


What is a socket address?

524


How to find other end of unix socket connection?

516


What is socket address with example?

495


How can I tell when a socket is closed on the other end?

975


Can a socket have multiple ports?

506


What is the difference between read() and recv()?

1598


Whats the difference between select() and poll()?

1214


What are the pros/cons of select(), non-blocking I/O and SIGIO?

978


Is a socket a file?

480