From e8b613e625d18a03d14073e4634cdfb64e120d38 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 28 Mar 2014 12:26:33 -0700 Subject: TCP connections work on Windows now. --- node/TcpSocket.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'node/TcpSocket.cpp') diff --git a/node/TcpSocket.cpp b/node/TcpSocket.cpp index 5d475c93..fd8e9a94 100644 --- a/node/TcpSocket.cpp +++ b/node/TcpSocket.cpp @@ -164,6 +164,16 @@ bool TcpSocket::notifyAvailableForWrite(const SharedPtr &self,SocketMana if (_outptr) { int n = (int)::send(_sock,(const char *)_outbuf,_outptr,0); +#ifdef __WINDOWS__ + if (n == SOCKET_ERROR) { + switch(WSAGetLastError()) { + case WSAEINTR: + case WSAEWOULDBLOCK: + break; + default: + return false; + } +#else if (n <= 0) { switch(errno) { #ifdef EAGAIN @@ -179,6 +189,7 @@ bool TcpSocket::notifyAvailableForWrite(const SharedPtr &self,SocketMana default: return false; } +#endif } else memmove(_outbuf,_outbuf + (unsigned int)n,_outptr -= (unsigned int)n); } -- cgit v1.2.3