Loading src/windows/tcp.cpp +14 −10 Changes for src/windows/tcp.cpp: 14 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -204,17 +204,19 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){ SOCKET rval=::WSASend(_Socket,&buf,1,&dwsend,flags,&_Overlapped,nullptr); NetException exception; int etype = NetException::Error; if(rval == SOCKET_ERROR){ DWORD lerror=GetLastError(); if (lerror == WSA_IO_PENDING || lerror == WSAEWOULDBLOCK) { return(size_t)dwsend; } else{ NetException exception; exception[NetException::Error] << "Socket senddata failed on Socket: " << (int)_Socket etype = NetException::Note; } exception[etype] << "Socket senddata failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } } return (size_t)dwsend; } Loading @@ -231,18 +233,20 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ int rval=::WSARecv(_Socket, &buf, 1,&dwBytes,(LPDWORD) &flags, &_Overlapped, nullptr); NetException exception; 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; } else { NetException exception; exception[NetException::Error] << "Socket senddata failed on Socket: " << (int)_Socket exception[etype] << "Socket senddata failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } } return (size_t)dwBytes; } Loading Loading
src/windows/tcp.cpp +14 −10 Changes for src/windows/tcp.cpp: 14 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -204,17 +204,19 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){ SOCKET rval=::WSASend(_Socket,&buf,1,&dwsend,flags,&_Overlapped,nullptr); NetException exception; int etype = NetException::Error; if(rval == SOCKET_ERROR){ DWORD lerror=GetLastError(); if (lerror == WSA_IO_PENDING || lerror == WSAEWOULDBLOCK) { return(size_t)dwsend; } else{ NetException exception; exception[NetException::Error] << "Socket senddata failed on Socket: " << (int)_Socket etype = NetException::Note; } exception[etype] << "Socket senddata failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } } return (size_t)dwsend; } Loading @@ -231,18 +233,20 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ int rval=::WSARecv(_Socket, &buf, 1,&dwBytes,(LPDWORD) &flags, &_Overlapped, nullptr); NetException exception; 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; } else { NetException exception; exception[NetException::Error] << "Socket senddata failed on Socket: " << (int)_Socket exception[etype] << "Socket senddata failed on Socket: " << (int)_Socket << " ErrorMsg: " << lerror; throw exception; } } return (size_t)dwBytes; } Loading