Select(2)/Read(2) and/or socket programming problem

Timothy Leight leight at mozartamd.com
Tue Jun 12 08:09:02 AEST 1990


Can anyone out there give me some hints as to what
is causing this problem:

In attempting to read from a socket, I first use a select(2),
to wait on data to arrive on the socket. The select(2) call 
returns with errno=0 and the correct discriptor
value. After checking everything, I then read(2) from
the socket descriptor. In checking the number of characters read 
from the socket, I find the number of characters in the buffer 
is zero and errno after the read(2) is zero.

This happens about 1% of the time this section of code is
executed. The rest of the time the code works as I 
expect it to, returning a non-zero number of characters in
a buffer.

Any hints at all about what could be happening whould  be
appreciated.


Thanks in advance

Tim Leight



More information about the Comp.unix.wizards mailing list