aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/client.cpp2
-rw-r--r--src/socket.cpp10
2 files changed, 12 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 81f2285..43d1a08 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -27,6 +27,8 @@ Bu::Client::Client( Bu::Socket *pSocket, class Bu::ClientLinkFactory *pfLink ) :
27 27
28Bu::Client::~Client() 28Bu::Client::~Client()
29{ 29{
30 delete pSocket;
31 pSocket = NULL;
30} 32}
31 33
32void Bu::Client::processInput() 34void Bu::Client::processInput()
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 )