From: newsham AT lava DOT net (Tim Newsham) Subject: socket read() bug 8 May 1998 17:21:41 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit To: cygwin32-developers AT cygnus DOT com 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.