Loading src/event/iocp.cpp +14 −6 Changes for src/event/iocp.cpp: 14 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -115,14 +115,23 @@ namespace netplus { } g_eventapi->ConnectEvent(*pClientContext->CurCon, tid, args); try { buffer buf(0); for (;;) { try { size_t recv = pClientContext->CurCon->csock->recvData(buf, 0); } catch (NetException& e) { break; } catch (NetException& e) { if (e.getErrorType() == NetException::Note) { continue; } else if (e.getErrorType() == NetException::Error) { std::cerr << e.what() << std::endl; if (e.getErrorType() != NetException::Note) throw e; g_eventapi->DisconnectEvent(*pClientContext->CurCon, tid, args); delete pClientContext; return; } }; } } Loading Loading @@ -295,7 +304,6 @@ namespace netplus { }break; } } catch (NetException& e) { std::cout << e.getErrorType() << std::endl; if (e.getErrorType() != NetException::Note) { std::cerr << e.what() << std::endl; pClientContext->cltmtx.lock(); Loading src/exception.h +1 −1 Changes for src/exception.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ namespace netplus { const std::string &what() const; enum Type {Note,Warning,Error,Critical,Close}; enum Type {Note=0,Warning=-1,Error=-2,Critical=-3,Close=-4}; NetException& append(const std::string& src); NetException& operator[](int errtype); Loading src/windows/tcp.cpp +5 −5 Changes for src/windows/tcp.cpp: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -246,15 +246,15 @@ size_t netplus::tcp::recvData(buffer &data,int flags){ if (rval == SOCKET_ERROR) { switch (WSAGetLastError()) { case WSAEWOULDBLOCK: throw exception[NetException::Note] << "Socket senddata failed WSAWOULDBLOCK on Socket: " << (int)_Socket; throw exception[NetException::Note] << "Socket recvData failed WSAWOULDBLOCK on Socket: " << (int)_Socket; case WSA_IO_PENDING: throw exception[NetException::Note] << "Socket senddata failed WSA_IO_PENDING on Socket: " << (int)_Socket; throw exception[NetException::Note] << "Socket recvData failed WSA_IO_PENDING on Socket: " << (int)_Socket; case WSAENOTCONN: throw exception[NetException::Error] << "Socket senddata failed WSAENOTCONN on Socket: " << (int)_Socket; throw exception[NetException::Error] << "Socket recvData failed WSAENOTCONN on Socket: " << (int)_Socket; case WSAECONNRESET: throw exception[NetException::Error] << "Socket senddata failed WSAECONNRESET on Socket: " << (int)_Socket; throw exception[NetException::Error] << "Socket recvData failed WSAECONNRESET on Socket: " << (int)_Socket; default: throw exception[NetException::Error] << "Socket senddata failed some Error on Socket: " << (int)_Socket; throw exception[NetException::Error] << "Socket recvData failed some Error on Socket: " << (int)_Socket; } } Loading Loading
src/event/iocp.cpp +14 −6 Changes for src/event/iocp.cpp: 14 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -115,14 +115,23 @@ namespace netplus { } g_eventapi->ConnectEvent(*pClientContext->CurCon, tid, args); try { buffer buf(0); for (;;) { try { size_t recv = pClientContext->CurCon->csock->recvData(buf, 0); } catch (NetException& e) { break; } catch (NetException& e) { if (e.getErrorType() == NetException::Note) { continue; } else if (e.getErrorType() == NetException::Error) { std::cerr << e.what() << std::endl; if (e.getErrorType() != NetException::Note) throw e; g_eventapi->DisconnectEvent(*pClientContext->CurCon, tid, args); delete pClientContext; return; } }; } } Loading Loading @@ -295,7 +304,6 @@ namespace netplus { }break; } } catch (NetException& e) { std::cout << e.getErrorType() << std::endl; if (e.getErrorType() != NetException::Note) { std::cerr << e.what() << std::endl; pClientContext->cltmtx.lock(); Loading
src/exception.h +1 −1 Changes for src/exception.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ namespace netplus { const std::string &what() const; enum Type {Note,Warning,Error,Critical,Close}; enum Type {Note=0,Warning=-1,Error=-2,Critical=-3,Close=-4}; NetException& append(const std::string& src); NetException& operator[](int errtype); Loading
src/windows/tcp.cpp +5 −5 Changes for src/windows/tcp.cpp: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -246,15 +246,15 @@ size_t netplus::tcp::recvData(buffer &data,int flags){ if (rval == SOCKET_ERROR) { switch (WSAGetLastError()) { case WSAEWOULDBLOCK: throw exception[NetException::Note] << "Socket senddata failed WSAWOULDBLOCK on Socket: " << (int)_Socket; throw exception[NetException::Note] << "Socket recvData failed WSAWOULDBLOCK on Socket: " << (int)_Socket; case WSA_IO_PENDING: throw exception[NetException::Note] << "Socket senddata failed WSA_IO_PENDING on Socket: " << (int)_Socket; throw exception[NetException::Note] << "Socket recvData failed WSA_IO_PENDING on Socket: " << (int)_Socket; case WSAENOTCONN: throw exception[NetException::Error] << "Socket senddata failed WSAENOTCONN on Socket: " << (int)_Socket; throw exception[NetException::Error] << "Socket recvData failed WSAENOTCONN on Socket: " << (int)_Socket; case WSAECONNRESET: throw exception[NetException::Error] << "Socket senddata failed WSAECONNRESET on Socket: " << (int)_Socket; throw exception[NetException::Error] << "Socket recvData failed WSAECONNRESET on Socket: " << (int)_Socket; default: throw exception[NetException::Error] << "Socket senddata failed some Error on Socket: " << (int)_Socket; throw exception[NetException::Error] << "Socket recvData failed some Error on Socket: " << (int)_Socket; } } Loading