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

test

parent dcadc3c7
Loading
Loading
Loading
Loading
+9 −6
Changes for src/event/iocp.cpp: 9 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -232,10 +232,10 @@ namespace netplus {
					} else if (dwError == ERROR_OPERATION_ABORTED) {
						continue;
					} else {
						NetException exp;
						exp[NetException::Critical] << "GetQueuedCompletionStatus failed with error: " << dwError;
						throw exp;
	
						//NetException exp;
						//exp[NetException::Critical] << "GetQueuedCompletionStatus failed with error: " << dwError;
						//throw exp;
						continue;
					}
				}

@@ -245,12 +245,12 @@ namespace netplus {

				client *pClientContext = reinterpret_cast<client*>(lpContext);				

				std::unique_lock<std::mutex> clock(pClientContext->cltmtx);

				try {
					con *curCon = pClientContext->CurCon;
					switch (pClientContext->State) {
						case IO_WRITE_STATE: {
							std::unique_lock<std::mutex> clock(pClientContext->cltmtx);

							eargs->event->ResponseEvent(*curCon, tid, args);
	
							ULONG ssize = curCon->SendData.size() < BLOCKSIZE ? (ULONG)curCon->SendData.size() : BLOCKSIZE;
@@ -269,6 +269,7 @@ namespace netplus {
							}
						}break;
						case IO_READ_STATE: {
							std::unique_lock<std::mutex> clock(pClientContext->cltmtx);

							buffer buf(BLOCKSIZE);

@@ -295,10 +296,12 @@ namespace netplus {
				} catch (NetException& e) {
					std::cerr << e.what() << std::endl;
					eargs->event->DisconnectEvent(*pClientContext->CurCon, tid, args);
					WSACloseEvent(pClientContext->CurCon->csock->_Overlapped.hEvent);
					delete pClientContext->CurCon->csock;
					delete pClientContext;
				} catch (...) {
					eargs->event->DisconnectEvent(*pClientContext->CurCon, tid, args);
					WSACloseEvent(pClientContext->CurCon->csock->_Overlapped.hEvent);
					delete pClientContext->CurCon->csock;
					delete pClientContext;
				}