Loading src/event/iocp.cpp +6 −7 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ namespace netplus { SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); threads = sysinfo.dwNumberOfProcessors; threads = 2;// sysinfo.dwNumberOfProcessors; } event::~event() { Loading Loading @@ -251,8 +251,7 @@ namespace netplus { &pOverlapped, WSA_INFINITE); if (!eargs->mtx->try_lock()) continue; eargs->mtx->lock(); if (lpContext == 0) { eargs->mtx->unlock(); Loading @@ -268,7 +267,7 @@ namespace netplus { } try { if (!((con*)pClientContext->CurCon)->SendData.empty()) { if (pClientContext->CurCon && !((con*)pClientContext->CurCon)->SendData.empty()) { dwFlags = 0; Loading @@ -284,9 +283,9 @@ namespace netplus { } catch (NetException& e) { std::cerr << e.what() << std::endl; } } else { } else { dwFlags = 0; std::shared_ptr<char[]> buf(new char[16384], std::default_delete<char[]>()); Loading @@ -304,8 +303,8 @@ namespace netplus { catch (NetException& e) { std::cerr << e.what() << std::endl; eargs->evpoll->RemoveFromClientList(pClientContext); pClientContext = nullptr; } eargs->mtx->unlock(); } // while } Loading src/posix/tcp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){ throw exception; } return (size_t) rval; return (size_t) rval != 0 ? rval : size; } Loading Loading @@ -225,7 +225,7 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ << " ErrorMsg: " << errstr; throw exception; } return (size_t)recvsize; return (size_t)recvsize != 0 ? recvsize : size; } void netplus::tcp::connect(socket *ssock){ Loading src/windows/tcp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ SENDDATA: << " ErrorMsg: " << lerror; throw exception; } return (size_t) rval; return (size_t) rval != 0 ? rval : size; } size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ Loading Loading @@ -218,7 +218,7 @@ RECVDATA: throw exception; } return (size_t) recvsize; return (size_t) recvsize != 0 ? recvsize : size; } void netplus::tcp::connect(socket *ssock){ Loading Loading
src/event/iocp.cpp +6 −7 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ namespace netplus { SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); threads = sysinfo.dwNumberOfProcessors; threads = 2;// sysinfo.dwNumberOfProcessors; } event::~event() { Loading Loading @@ -251,8 +251,7 @@ namespace netplus { &pOverlapped, WSA_INFINITE); if (!eargs->mtx->try_lock()) continue; eargs->mtx->lock(); if (lpContext == 0) { eargs->mtx->unlock(); Loading @@ -268,7 +267,7 @@ namespace netplus { } try { if (!((con*)pClientContext->CurCon)->SendData.empty()) { if (pClientContext->CurCon && !((con*)pClientContext->CurCon)->SendData.empty()) { dwFlags = 0; Loading @@ -284,9 +283,9 @@ namespace netplus { } catch (NetException& e) { std::cerr << e.what() << std::endl; } } else { } else { dwFlags = 0; std::shared_ptr<char[]> buf(new char[16384], std::default_delete<char[]>()); Loading @@ -304,8 +303,8 @@ namespace netplus { catch (NetException& e) { std::cerr << e.what() << std::endl; eargs->evpoll->RemoveFromClientList(pClientContext); pClientContext = nullptr; } eargs->mtx->unlock(); } // while } Loading
src/posix/tcp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){ throw exception; } return (size_t) rval; return (size_t) rval != 0 ? rval : size; } Loading Loading @@ -225,7 +225,7 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ << " ErrorMsg: " << errstr; throw exception; } return (size_t)recvsize; return (size_t)recvsize != 0 ? recvsize : size; } void netplus::tcp::connect(socket *ssock){ Loading
src/windows/tcp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ SENDDATA: << " ErrorMsg: " << lerror; throw exception; } return (size_t) rval; return (size_t) rval != 0 ? rval : size; } size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){ Loading Loading @@ -218,7 +218,7 @@ RECVDATA: throw exception; } return (size_t) recvsize; return (size_t) recvsize != 0 ? recvsize : size; } void netplus::tcp::connect(socket *ssock){ Loading