Loading src/event/iocp.cpp +9 −2 Changes for src/event/iocp.cpp: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -256,7 +256,7 @@ namespace netplus { client *pClientContext = reinterpret_cast<client*>(lpContext); std::lock_guard<std::mutex> clock(pClientContext->cltmtx); std::unique_lock<std::mutex> clock(pClientContext->cltmtx); try { con *curCon = pClientContext->CurCon; Loading Loading @@ -287,12 +287,13 @@ namespace netplus { // Erase the sent data from the beginning of the buffer curCon->SendData.resize(ret); if (curCon->SendData.empty()) { pClientContext->State = IO_READ_STATE; pClientContext->State = IO_CLOSE_STATE; } else { continue; } }break; case IO_READ_STATE: { buffer buf(BLOCKSIZE); size_t recv = 0; Loading Loading @@ -321,6 +322,12 @@ namespace netplus { continue; } }break; case IO_CLOSE_STATE: { eargs->event->DisconnectEvent(*curCon, tid, args); delete curCon->csock; delete pClientContext; } break; default: { NetException exp; exp[NetException::Error] << "Unknown IO state: " << pClientContext->State; Loading Loading
src/event/iocp.cpp +9 −2 Changes for src/event/iocp.cpp: 9 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -256,7 +256,7 @@ namespace netplus { client *pClientContext = reinterpret_cast<client*>(lpContext); std::lock_guard<std::mutex> clock(pClientContext->cltmtx); std::unique_lock<std::mutex> clock(pClientContext->cltmtx); try { con *curCon = pClientContext->CurCon; Loading Loading @@ -287,12 +287,13 @@ namespace netplus { // Erase the sent data from the beginning of the buffer curCon->SendData.resize(ret); if (curCon->SendData.empty()) { pClientContext->State = IO_READ_STATE; pClientContext->State = IO_CLOSE_STATE; } else { continue; } }break; case IO_READ_STATE: { buffer buf(BLOCKSIZE); size_t recv = 0; Loading Loading @@ -321,6 +322,12 @@ namespace netplus { continue; } }break; case IO_CLOSE_STATE: { eargs->event->DisconnectEvent(*curCon, tid, args); delete curCon->csock; delete pClientContext; } break; default: { NetException exp; exp[NetException::Error] << "Unknown IO state: " << pClientContext->State; Loading