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

bachward

parent cc1c2774
Loading
Loading
Loading
Loading
+7 −9
Changes for src/windows/tcp.cpp: 7 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -199,9 +199,7 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){
    buf.len = size;

    DWORD dwFlags = 0;
    DWORD dwBytes = 0;

    SOCKET rval=::WSASend(_Socket,&buf,1,&dwBytes,flags,&_Overlapped,nullptr);
    SOCKET rval=::WSASend(_Socket,&buf,1,nullptr,flags,&_Overlapped,nullptr);

    if(rval == SOCKET_ERROR){
        DWORD lerror=GetLastError();
@@ -209,7 +207,7 @@ size_t netplus::tcp::sendData(void* data, unsigned long size,int flags){
        int etype = NetException::Error;

        if (lerror == WSA_IO_PENDING) {
            return 0;
            etype = NetException::Note;
        }

        exception[etype] << "Socket senddata failed on Socket: " << (int) _Socket
@@ -228,18 +226,18 @@ size_t netplus::tcp::recvData(void* data, unsigned long size,int flags){
    buf.len =        size;

    DWORD dwFlags = 0;
    DWORD dwBytes = 0;

    int recvsize=::WSARecv(_Socket, &buf, 1,&dwBytes,(LPDWORD) &flags, &_Overlapped, nullptr);
    int recvsize=::WSARecv(_Socket, &buf, 1,nullptr,(LPDWORD) &flags, &_Overlapped, nullptr);

    if(recvsize==SOCKET_ERROR){
        DWORD lerror = GetLastError();

        int etype = NetException::Error;

        if (lerror == WSA_IO_PENDING) {
            return 0;
            etype = NetException::Note;
        }

        exception[NetException::Error] << "Socket recvdata failed on Socket: " << (int)_Socket
        exception[etype] << "Socket recvdata failed on Socket: " << (int)_Socket
                                       << " ErrorMsg: " << lerror;
        throw exception;
    }