Loading src/event/iocp.cpp +2 −5 Changes for src/event/iocp.cpp: 2 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ namespace netplus { switch (pClientContext->State) { case IO_WRITE_STATE: { pClientContext->cltmtx.lock(); std::unique_lock<std::mutex> clock(pClientContext->cltmtx); eargs->event->ResponseEvent(curCon, tid, args); Loading @@ -284,7 +284,7 @@ namespace netplus { pClientContext->cltmtx.unlock(); }break; case IO_READ_STATE: { pClientContext->cltmtx.lock(); std::unique_lock<std::mutex> clock(pClientContext->cltmtx); std::shared_ptr<char[]> buf(new char[BLOCKSIZE], std::default_delete<char[]>()); size_t recv = curCon->csock->recvData(buf.get(), BLOCKSIZE, 0); Loading @@ -293,7 +293,6 @@ namespace netplus { eargs->event->RequestEvent(curCon, tid, args); if (!curCon->SendData.empty()) pClientContext->State = IO_WRITE_STATE; pClientContext->cltmtx.unlock(); }break; case IO_CLOSE_STATE: { eargs->evpoll->RemoveFromClientList(pClientContext); Loading @@ -305,13 +304,11 @@ namespace netplus { if (e.getErrorType() != NetException::Note) { pClientContext->State = IO_CLOSE_STATE; } pClientContext->cltmtx.unlock(); continue; } catch (...) { std::cerr << "unknown error close coonection !" << std::endl; pClientContext->State = IO_CLOSE_STATE; pClientContext->cltmtx.unlock(); continue; } Loading Loading
src/event/iocp.cpp +2 −5 Changes for src/event/iocp.cpp: 2 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ namespace netplus { switch (pClientContext->State) { case IO_WRITE_STATE: { pClientContext->cltmtx.lock(); std::unique_lock<std::mutex> clock(pClientContext->cltmtx); eargs->event->ResponseEvent(curCon, tid, args); Loading @@ -284,7 +284,7 @@ namespace netplus { pClientContext->cltmtx.unlock(); }break; case IO_READ_STATE: { pClientContext->cltmtx.lock(); std::unique_lock<std::mutex> clock(pClientContext->cltmtx); std::shared_ptr<char[]> buf(new char[BLOCKSIZE], std::default_delete<char[]>()); size_t recv = curCon->csock->recvData(buf.get(), BLOCKSIZE, 0); Loading @@ -293,7 +293,6 @@ namespace netplus { eargs->event->RequestEvent(curCon, tid, args); if (!curCon->SendData.empty()) pClientContext->State = IO_WRITE_STATE; pClientContext->cltmtx.unlock(); }break; case IO_CLOSE_STATE: { eargs->evpoll->RemoveFromClientList(pClientContext); Loading @@ -305,13 +304,11 @@ namespace netplus { if (e.getErrorType() != NetException::Note) { pClientContext->State = IO_CLOSE_STATE; } pClientContext->cltmtx.unlock(); continue; } catch (...) { std::cerr << "unknown error close coonection !" << std::endl; pClientContext->State = IO_CLOSE_STATE; pClientContext->cltmtx.unlock(); continue; } Loading