Ticket #3123: socket.patch

File socket.patch, 1.0 KB (added by Tim Kosse, 17 years ago)
  • 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
     
    11681168    else
    11691169      ret = Recv_Dgram(buffer, size);
    11701170
    1171     /* If recv returned zero, then the connection is lost, and errno is not set.
     1171    /* If recv returned zero, then the connection has been gracefully closed.
    11721172     * Otherwise, recv has returned an error (-1), in which case we have lost the
    11731173     * socket only if errno does _not_ indicate that there may be more data to read.
    11741174     */
    11751175    if (ret == 0)
    11761176    {
    1177       m_error = GSOCK_IOERR;
     1177      /* Make sure wxSOCKET_LOST event gets sent */
    11781178      m_detected = GSOCK_LOST_FLAG;
    1179       Close();
    1180       // Signal an error for return
    1181       return -1;
     1179      Detected_Read();
     1180      return 0;
    11821181    }
    11831182    else if (ret == -1)
    11841183    {