Mail Archives: cygwin-developers/1998/05/08/17:21:41
Hi,
I stumbled across another socket bug. This time I don't have
a test program to reproduce it yet, but I have a program in which
it regularly occurs. The problem -- sometimes a read() on a socket
will return 0 when EOF has not yet been reached. (I have some
recv/read/recvfrom patches applied, I am HOPING these arent the
cause of the problem, if they are, then the problem may be elsewhere
in select() or FIONREAD for example).
So this is what is happening, read() on a socket is occasionally
returning zero. If I set a breakpoint to the point right after
this occurs, and I do a "print read(fd, buf, 1)" it properly
reads the next char. So, it looks like winsock incorrectly returns
zero in some cases when EOF has not yet been reached, but there
are no chars to be read yet.
I will do some more digging and hopefully come up with a test program.
Tim N.
- Raw text -