From c2292209eb4ece185f555a5c7823726794fe34cc Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 29 Jul 2009 19:01:02 +0000 Subject: Wow, socket, as it turned out, was not able to close after the remote end disconnected. It now automatically closes down the local end when the remote end dies. --- src/socket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/socket.cpp') diff --git a/src/socket.cpp b/src/socket.cpp index 46e6cd7..3ddc492 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -159,7 +159,7 @@ size_t Bu::Socket::read( void *pBuf, size_t nBytes ) bu_recv( nSocket, (char *) pBuf, nBytes, 0 ) ); if( nRead == 0 ) { - bActive = false; + close(); throw SocketException( SocketException::cClosed, "Socket closed."); } if( nRead < 0 ) @@ -171,7 +171,7 @@ size_t Bu::Socket::read( void *pBuf, size_t nBytes ) #else if( errno == ENETRESET || errno == ECONNRESET ) { - bActive = false; + close(); throw SocketException( SocketException::cClosed, strerror(errno) ); } -- cgit v1.2.3