summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid <david@xagasoft.com>2009-01-14 21:43:24 +0000
committerDavid <david@xagasoft.com>2009-01-14 21:43:24 +0000
commit422a09d330d15f90c854dcc1001a544ffd4b4967 (patch)
tree05547f0fb4211e28476dd5164e80bb5003cf3079 /src
parenta10b1fd0b76fab720d2430315da7ac80776204e6 (diff)
downloadlibbu++-422a09d330d15f90c854dcc1001a544ffd4b4967.tar.gz
libbu++-422a09d330d15f90c854dcc1001a544ffd4b4967.tar.bz2
libbu++-422a09d330d15f90c854dcc1001a544ffd4b4967.tar.xz
libbu++-422a09d330d15f90c854dcc1001a544ffd4b4967.zip
david - oy, ok uses WSAGetLastError now on windows...
Diffstat (limited to 'src')
-rw-r--r--src/socket.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 1c53ec8..c93ec6e 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -219,9 +219,17 @@ size_t Bu::Socket::read( void *pBuf, size_t nBytes )
219#endif 219#endif
220 if( nRead < 0 ) 220 if( nRead < 0 )
221 { 221 {
222#ifdef WIN32
223 int iWSAError = DYNLOAD WSAGetLastError();
224 if( iWSAError == WSAEWOULDBLOCK )
225 return 0;
226 printf( "WSAGetLastError: %d\n", iWSAError );
227 return 0;
228#else
222 if( errno == EAGAIN ) 229 if( errno == EAGAIN )
223 return 0; 230 return 0;
224 throw SocketException( SocketException::cRead, strerror(errno) ); 231 throw SocketException( SocketException::cRead, strerror(errno) );
232#endif
225 } 233 }
226 return nRead; 234 return nRead;
227} 235}