Commit f82c3b38 authored by jan.koester's avatar jan.koester
Browse files

test

parent 546f7c92
Loading
Loading
Loading
Loading
+5 −2
Changes for src/event/iocp.cpp: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -255,13 +255,13 @@ namespace netplus {
					continue;
				}

				std::lock_guard<std::mutex> lock(pClientContext->cltmtx);

				try {
					auto& curCon = pClientContext->CurCon;

					switch (pClientContext->State) {
					case IO_WRITE_STATE: {
						std::lock_guard<std::mutex> lock(pClientContext->cltmtx);

						eargs->event->ResponseEvent(curCon, tid, args);

						ULONG ssize = curCon->SendData.size() < BLOCKSIZE ? (ULONG)curCon->SendData.size() : BLOCKSIZE;
@@ -272,6 +272,8 @@ namespace netplus {
							pClientContext->State = IO_READ_STATE;
					}break;
					case IO_READ_STATE: {
						std::lock_guard<std::mutex> lock(pClientContext->cltmtx);

						std::shared_ptr<char[]> buf(new char[BLOCKSIZE], std::default_delete<char[]>());
						size_t recv = curCon->csock->recvData(buf.get(), BLOCKSIZE, 0);
						curCon->RecvData.append(buf.get(), recv);
@@ -281,6 +283,7 @@ namespace netplus {
							pClientContext->State = IO_WRITE_STATE;
					}break;
					case IO_CLOSE_STATE: {
						pClientContext->cltmtx.lock();
						WSACloseEvent(pClientContext->CurCon->csock->_Overlapped.hEvent);
						eargs->evpoll->RemoveFromClientList(pClientContext);
					}continue;