Index: src/unix/gsocket.cpp =================================================================== RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/unix/gsocket.cpp,v retrieving revision 1.67.2.2 diff -u -r1.67.2.2 gsocket.cpp --- src/unix/gsocket.cpp 2007/03/17 02:15:29 1.67.2.2 +++ src/unix/gsocket.cpp 2007/03/25 19:28:24 @@ -1168,17 +1168,16 @@ else ret = Recv_Dgram(buffer, size); - /* If recv returned zero, then the connection is lost, and errno is not set. + /* If recv returned zero, then the connection has been gracefully closed. * Otherwise, recv has returned an error (-1), in which case we have lost the * socket only if errno does _not_ indicate that there may be more data to read. */ if (ret == 0) { - m_error = GSOCK_IOERR; + /* Make sure wxSOCKET_LOST event gets sent */ m_detected = GSOCK_LOST_FLAG; - Close(); - // Signal an error for return - return -1; + Detected_Read(); + return 0; } else if (ret == -1) {