Commit 7d1aba2f authored by jan.koester's avatar jan.koester
Browse files

test

parent 1e973b85
Loading
Loading
Loading
Loading
+7 −5
Changes for src/event/iocp.cpp: 7 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -58,14 +58,15 @@ namespace netplus {

	class client {
	public:
		client(eventapi* eapi) {
			api = eapi;
		client(eventapi* eapi) : api(eapi), State(nullptr), CurCon(nullptr) {
			api->CreateConnetion(&CurCon);
		};
		}

		~client() {
			if (CurCon) {
				api->deleteConnetion(CurCon);
		};
			}
		}

		HANDLE     State;
		eventapi*  api;
@@ -88,8 +89,9 @@ namespace netplus {
			HANDLE giocp2 = CreateIoCompletionPort((HANDLE)(pClientContext)->CurCon->csock->fd(), g_iocp, (ULONG_PTR)pClientContext, 0);

			if (!giocp2 || g_iocp != giocp2) {
				DWORD err = GetLastError();
				NetException exp;
				exp[NetException::Error] << "Error occurred while AssociateWithIOCP:  << GetLastError()";
				exp[NetException::Error] << "AssociateWithIOCP fehlgeschlagen: Fehlercode " << err;
				throw exp;
			}
		}