Loading src/windows/tcp.cpp +8 −5 Changes for src/windows/tcp.cpp: 8 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -205,12 +205,14 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){ NetException exception; int etype = NetException::Error; if(rval == SOCKET_ERROR){ DWORD lerror=GetLastError(); if (lerror == WSA_IO_PENDING || lerror == WSAEWOULDBLOCK) { return (size_t)dwsend; etype = NetException::Note; } exception[NetException::Error] << "Socket senddata failed on Socket: " << (int)_Socket exception[etype] << "Socket senddata failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } Loading @@ -224,17 +226,18 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ buf.buf = reinterpret_cast<char*>(data); buf.len = size; DWORD dwBytes = 0; int rval=::WSARecv(_Socket, &buf, 1,&dwBytes,(LPDWORD) &flags, &_Overlapped, nullptr); int etype = NetException::Error; if (rval == SOCKET_ERROR) { DWORD lerror = GetLastError(); if (lerror == WSA_IO_PENDING || lerror == WSAEWOULDBLOCK) { return (size_t)dwBytes; etype = NetException::Note; } exception[NetException::Error] << "Socket Recv failed on Socket: " << (int)_Socket exception[etype] << "Socket Recv failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } Loading Loading
src/windows/tcp.cpp +8 −5 Changes for src/windows/tcp.cpp: 8 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -205,12 +205,14 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){ NetException exception; int etype = NetException::Error; if(rval == SOCKET_ERROR){ DWORD lerror=GetLastError(); if (lerror == WSA_IO_PENDING || lerror == WSAEWOULDBLOCK) { return (size_t)dwsend; etype = NetException::Note; } exception[NetException::Error] << "Socket senddata failed on Socket: " << (int)_Socket exception[etype] << "Socket senddata failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } Loading @@ -224,17 +226,18 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ buf.buf = reinterpret_cast<char*>(data); buf.len = size; DWORD dwBytes = 0; int rval=::WSARecv(_Socket, &buf, 1,&dwBytes,(LPDWORD) &flags, &_Overlapped, nullptr); int etype = NetException::Error; if (rval == SOCKET_ERROR) { DWORD lerror = GetLastError(); if (lerror == WSA_IO_PENDING || lerror == WSAEWOULDBLOCK) { return (size_t)dwBytes; etype = NetException::Note; } exception[NetException::Error] << "Socket Recv failed on Socket: " << (int)_Socket exception[etype] << "Socket Recv failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } Loading