Problem with select(2)/read(2) and/or socket programming

Timothy S. Leight leight at mozart.amd.com
Tue Jun 12 08:31:35 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
the buffer.

Any help all would be appreciated.

Thanks in advance

tim leight
leight at mozart.amd.com



More information about the Comp.unix.wizards mailing list