Backporting from my SoC branch, fix for remotely closed sockets firing input events till destroyed or closed locally.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Angel Vidal Veiga
2006-08-06 04:46:57 +00:00
parent 2dc3af5058
commit 98e7a7f97f

View File

@@ -1084,7 +1084,13 @@ int GSocket::Read(char *buffer, int size)
* socket only if errno does _not_ indicate that there may be more data to read. * socket only if errno does _not_ indicate that there may be more data to read.
*/ */
if (ret == 0) if (ret == 0)
{
m_error = GSOCK_IOERR; m_error = GSOCK_IOERR;
m_detected = GSOCK_LOST_FLAG;
Close();
// Signal an error for return
return -1;
}
else if (ret == -1) else if (ret == -1)
{ {
if ((errno == EWOULDBLOCK) || (errno == EAGAIN)) if ((errno == EWOULDBLOCK) || (errno == EAGAIN))