Interview Questions

How come select says there is data, but read returns zero?

Unix Socket FAQ for Network programming


(Continued from previous question...)

How come select says there is data, but read returns zero?

The data that causes select to return is the EOF because the other side has closed the connection. This causes read to return zero.

(Continued on next question...)

Other Interview Questions