Browse Source

fix (2) work with nonblocking socket for Windows

pass-iguana-arg
DeckerSU 7 years ago
parent
commit
b17a01b384
  1. 4
      iguana/exchanges/LP_socket.c

4
iguana/exchanges/LP_socket.c

@ -62,14 +62,18 @@ int32_t komodo_connect(int32_t sock,struct sockaddr *saddr,socklen_t addrlen)
{
#ifdef _WIN32
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms737625%28v=vs.85%29.aspx - read about WSAEWOULDBLOCK return
errno = WSAGetLastError();
printf("[Decker] errno.%d --> ", errno);
if ( errno != EINPROGRESS && errno != WSAEWOULDBLOCK ) // connect failed, do something...
#else
if ( errno != EINPROGRESS ) // connect failed, do something...
#endif
{
printf("close socket ...\n");
closesocket(sock);
return(-1);
}
printf("continue with select ...\n");
FD_ZERO(&wfd);
FD_SET(sock,&wfd);
FD_ZERO(&efd);

Loading…
Cancel
Save