This seems to work.. Daniel Walker
--- server/sock.c 2001/05/14 20:09:39 1.18 +++ server/sock.c 2001/08/21 01:31:04 @@ -113,9 +113,14 @@ { struct sock *sock = (struct sock *)obj; unsigned int emask; + char rBuf; assert( sock->obj.ops == &sock_ops ); if (debug_level) fprintf(stderr, "socket %d select event: %x\n", sock->obj.fd, event); + + if (event == POLLIN && !recvfrom(sock->obj.fd, &rBuf, sizeof(rBuf), MSG_PEEK, NULL, NULL)) + event = POLLHUP; + if (sock->state & WS_FD_CONNECT) { /* connecting */