windows fix

This commit is contained in:
Benjamin Sergeant 2019-01-05 17:02:39 -08:00
parent b1e2c4ce72
commit 3cb2f6dcf7
2 changed files with 13 additions and 7 deletions

View File

@ -76,13 +76,18 @@ namespace ix
// block us for too long
SocketConnect::configure(fd);
if (::connect(fd, address->ai_addr, address->ai_addrlen) == -1
&& errno != EINPROGRESS)
if (::connect(fd, address->ai_addr, address->ai_addrlen) == -1)
{
#ifdef _WIN32
if (Socket::getErrno() == EWOULDBLOCK) errno = EINPROGRESS;
#endif
if (errno != EINPROGRESS)
{
closeSocket(fd);
errMsg = strerror(errno);
return -1;
}
}
for (;;)
{

View File

@ -21,9 +21,11 @@ include_directories(
# Shared sources
set (SOURCES
test_runner.cpp
IXDNSLookupTest.cpp
IXTest.cpp
msgpack11.cpp
IXDNSLookupTest.cpp
IXSocketTest.cpp
)
# Some unittest don't work on windows yet
@ -31,7 +33,6 @@ if (NOT WIN32)
list(APPEND SOURCES
IXWebSocketServerTest.cpp
cmd_websocket_chat.cpp
IXSocketTest.cpp
)
endif()