diff options
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r-- | src/socketengine.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 72075dd49..ccaa71aed 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -208,7 +208,12 @@ int SocketEngine::SendTo(EventHandler* fd, const void *buf, size_t len, int flag int SocketEngine::Connect(EventHandler* fd, const sockaddr *serv_addr, socklen_t addrlen) { - return connect(fd->GetFd(), serv_addr, addrlen); + int ret = connect(fd->GetFd(), serv_addr, addrlen); +#ifdef WINDOWS + if ((ret == SOCKET_ERROR) && (WSAGetLastError() == WSAEWOULDBLOCK)) + errno = EINPROGRESS; +#endif + return ret; } int SocketEngine::Shutdown(EventHandler* fd, int how) |