diff options
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 ) | |||
159 | bu_recv( nSocket, (char *) pBuf, nBytes, 0 ) ); | 159 | bu_recv( nSocket, (char *) pBuf, nBytes, 0 ) ); |
160 | if( nRead == 0 ) | 160 | if( nRead == 0 ) |
161 | { | 161 | { |
162 | bActive = false; | 162 | close(); |
163 | throw SocketException( SocketException::cClosed, "Socket closed."); | 163 | throw SocketException( SocketException::cClosed, "Socket closed."); |
164 | } | 164 | } |
165 | if( nRead < 0 ) | 165 | if( nRead < 0 ) |
@@ -171,7 +171,7 @@ size_t Bu::Socket::read( void *pBuf, size_t nBytes ) | |||
171 | #else | 171 | #else |
172 | if( errno == ENETRESET || errno == ECONNRESET ) | 172 | if( errno == ENETRESET || errno == ECONNRESET ) |
173 | { | 173 | { |
174 | bActive = false; | 174 | close(); |
175 | throw SocketException( SocketException::cClosed, | 175 | throw SocketException( SocketException::cClosed, |
176 | strerror(errno) ); | 176 | strerror(errno) ); |
177 | } | 177 | } |