summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 3e4f3c7..c3781b0 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -160,6 +160,12 @@ size_t Bu::Socket::read( void *pBuf, size_t nBytes )
160 if( iWSAError == WSAEWOULDBLOCK ) 160 if( iWSAError == WSAEWOULDBLOCK )
161 return 0; 161 return 0;
162#else 162#else
163 if( errno == ENETRESET || errno == ECONNRESET )
164 {
165 bActive = false;
166 throw SocketException( SocketException::cClosed,
167 strerror(errno) );
168 }
163 if( errno == EAGAIN ) 169 if( errno == EAGAIN )
164 return 0; 170 return 0;
165 throw SocketException( SocketException::cRead, strerror(errno) ); 171 throw SocketException( SocketException::cRead, strerror(errno) );
@@ -356,7 +362,11 @@ bool Bu::Socket::isSeekable()
356 362
357bool Bu::Socket::isBlocking() 363bool Bu::Socket::isBlocking()
358{ 364{
365#ifndef WIN32
366 return ((fcntl( nSocket, F_GETFL, 0 ) & O_NONBLOCK) == O_NONBLOCK);
367#else
359 return false; 368 return false;
369#endif
360} 370}
361 371
362void Bu::Socket::setBlocking( bool bBlocking ) 372void Bu::Socket::setBlocking( bool bBlocking )