Commit 60c3f986 authored by jan.koester's avatar jan.koester
Browse files

test

parent 415593b1
Loading
Loading
Loading
Loading
+18
Changes for src/event/iocp.cpp: 18 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -284,6 +284,24 @@ namespace netplus {
						std::shared_ptr<char[]> buf(new char[BLOCKSIZE], std::default_delete<char[]>());
						size_t recv = pClientContext->CurCon->csock->recvData(buf.get(), BLOCKSIZE, 0);

						int flags=0;

						int rc = WSAGetOverlappedResult(
							pClientContext->CurCon->csock->fd(), 
							&pClientContext->CurCon->csock->_Overlapped,
							&dwBytes, 
							false,
							(LPDWORD)&flags
						);

						if (rc == FALSE) {
							NetException exception;
							exception[NetException::Error] << "WSARecv operation failed with error: " << WSAGetLastError();
							throw exception;
						}

						WSAResetEvent(pClientContext->CurCon->csock->_Overlapped.hEvent);

						pClientContext->CurCon->RecvData.append(buf.get(), recv);

						try {
−8
Changes for src/windows/tcp.cpp: 0 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -240,14 +240,6 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){
        }
    }

    int rc = WSAGetOverlappedResult(_Socket, &_Overlapped, &dwBytes, FALSE, (LPDWORD) &flags);
    if (rc == FALSE) {
        exception[NetException::Error] << "WSARecv operation failed with error: "<< WSAGetLastError();
        throw exception;
    }

    WSAResetEvent(_Overlapped.hEvent);

    return (size_t) recvsize;
}