From 422a09d330d15f90c854dcc1001a544ffd4b4967 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 14 Jan 2009 21:43:24 +0000 Subject: david - oy, ok uses WSAGetLastError now on windows... --- src/socket.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/socket.cpp') 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 ) #endif if( nRead < 0 ) { +#ifdef WIN32 + int iWSAError = DYNLOAD WSAGetLastError(); + if( iWSAError == WSAEWOULDBLOCK ) + return 0; + printf( "WSAGetLastError: %d\n", iWSAError ); + return 0; +#else if( errno == EAGAIN ) return 0; throw SocketException( SocketException::cRead, strerror(errno) ); +#endif } return nRead; } -- cgit v1.2.3