Fixed handling of winsock connect event. Was always immediately

indicating socket had connected.
This commit is contained in:
crs 2004-02-29 21:33:20 +00:00
parent 4ac756fc28
commit ffa966747b
1 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ CArchNetworkWinsock::newSocket(EAddressFamily family, ESocketType type)
setBlockingOnSocket(fd, false); setBlockingOnSocket(fd, false);
} }
catch (...) { catch (...) {
close(fd); close_winsock(fd);
throw; throw;
} }
@ -205,7 +205,7 @@ CArchNetworkWinsock::newSocket(EAddressFamily family, ESocketType type)
socket->m_socket = fd; socket->m_socket = fd;
socket->m_refCount = 1; socket->m_refCount = 1;
socket->m_event = WSACreateEvent_winsock(); socket->m_event = WSACreateEvent_winsock();
socket->m_pollWrite = false; socket->m_pollWrite = true;
return socket; return socket;
} }
@ -318,7 +318,7 @@ CArchNetworkWinsock::acceptSocket(CArchSocket s, CArchNetAddress* addr)
setBlockingOnSocket(fd, false); setBlockingOnSocket(fd, false);
} }
catch (...) { catch (...) {
close(fd); close_winsock(fd);
delete socket; delete socket;
free(tmp); free(tmp);
*addr = NULL; *addr = NULL;