Loading src/event/iocp.cpp +8 −9 Original line number Diff line number Diff line Loading @@ -145,8 +145,6 @@ namespace netplus { std::cerr.write(buf.get(), recv) << std::endl; g_eventapi->RequestEvent(pClientContext->CurCon, tid, args); } Loading Loading @@ -292,18 +290,19 @@ namespace netplus { //Get the data. ret = pClientContext->CurCon->csock->recvData(buf.get(), 16384, 0); if (ret > 0) { pClientContext->CurCon->RecvData.append(buf.get(), ret); eargs->event->RequestEvent(pClientContext->CurCon, tid, args); ret = pClientContext->CurCon->csock->sendData(buf.get(), ssize, 0); } } } catch (NetException& e) { std::cerr << e.what() << std::endl; if(e.getErrorType()!=NetException::Note) eargs->evpoll->RemoveFromClientList(pClientContext); pClientContext = nullptr; } eargs->mtx->unlock(); } // while Loading Loading @@ -344,7 +343,7 @@ namespace netplus { std::vector <std::thread> threadpool; for (int i = 1; i < threads; i++) { for (int i = 1; i < 2; i++) { try { threadpool.push_back(std::thread([&eargs, args, i] { EventWorker(i, args, &eargs); 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 != 0 ? rval : size; return (size_t) rval; } 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 != 0 ? recvsize : size; return (size_t) recvsize; } void netplus::tcp::connect(socket *ssock){ Loading src/windows/udp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ size_t netplus::udp::sendData(void* data, unsigned long size, int flags) { << " ErrorMsg: " << GetLastError(); throw exception; } return (size_t)rval == 0 ? size : rval; return (size_t)rval; } size_t netplus::udp::recvData(void* data, unsigned long size, int flags) { Loading @@ -201,7 +201,7 @@ size_t netplus::udp::recvData(void* data, unsigned long size, int flags) { << " ErrorMsg: " << GetLastError(); throw exception; } return (size_t)recvsize == 0 ? size : recvsize; return (size_t)recvsize; } void netplus::udp::connect(socket* ssock) { NetException exception; Loading Loading
src/event/iocp.cpp +8 −9 Original line number Diff line number Diff line Loading @@ -145,8 +145,6 @@ namespace netplus { std::cerr.write(buf.get(), recv) << std::endl; g_eventapi->RequestEvent(pClientContext->CurCon, tid, args); } Loading Loading @@ -292,18 +290,19 @@ namespace netplus { //Get the data. ret = pClientContext->CurCon->csock->recvData(buf.get(), 16384, 0); if (ret > 0) { pClientContext->CurCon->RecvData.append(buf.get(), ret); eargs->event->RequestEvent(pClientContext->CurCon, tid, args); ret = pClientContext->CurCon->csock->sendData(buf.get(), ssize, 0); } } } catch (NetException& e) { std::cerr << e.what() << std::endl; if(e.getErrorType()!=NetException::Note) eargs->evpoll->RemoveFromClientList(pClientContext); pClientContext = nullptr; } eargs->mtx->unlock(); } // while Loading Loading @@ -344,7 +343,7 @@ namespace netplus { std::vector <std::thread> threadpool; for (int i = 1; i < threads; i++) { for (int i = 1; i < 2; i++) { try { threadpool.push_back(std::thread([&eargs, args, i] { EventWorker(i, args, &eargs); 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 != 0 ? rval : size; return (size_t) rval; } 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 != 0 ? recvsize : size; return (size_t) recvsize; } void netplus::tcp::connect(socket *ssock){ Loading
src/windows/udp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ size_t netplus::udp::sendData(void* data, unsigned long size, int flags) { << " ErrorMsg: " << GetLastError(); throw exception; } return (size_t)rval == 0 ? size : rval; return (size_t)rval; } size_t netplus::udp::recvData(void* data, unsigned long size, int flags) { Loading @@ -201,7 +201,7 @@ size_t netplus::udp::recvData(void* data, unsigned long size, int flags) { << " ErrorMsg: " << GetLastError(); throw exception; } return (size_t)recvsize == 0 ? size : recvsize; return (size_t)recvsize; } void netplus::udp::connect(socket* ssock) { NetException exception; Loading