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

urgent

parent c4d88f8e
Loading
Loading
Loading
Loading
+6
Changes for src/windows/tcp.cpp: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -281,6 +281,12 @@ void netplus::tcp::connect(std::shared_ptr<socket> &csock){
        throw exception;
    }
    
    if (::WSAConnect(_Socket, ((struct addrinfo*)csock->_SocketInfo)->ai_addr,
        (int)((struct addrinfo*)csock->_SocketInfo)->ai_addrlen, nullptr, nullptr, nullptr, nullptr) < 0) {
        exception[NetException::Error] << "Socket connect: can't connect to server aborting " << " ErrorMsg:" << GetLastError();
        throw exception;
    }

    if (::getpeername(_Socket, ((struct addrinfo*)_SocketInfo)->ai_addr, (int*)&((struct addrinfo*)_SocketInfo)->ai_addrlen) < 0) {
        NetException exception;
        exception[NetException::Error] << "Connect: getpeername failed on " << (int)_Socket << " error code : " << GetLastError();
+6
Changes for src/windows/udp.cpp: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -276,6 +276,12 @@ void netplus::udp::connect(std::shared_ptr<socket> &csock) {
        throw exception;
    }

    if (::WSAConnect(_Socket, ((struct addrinfo*)csock->_SocketInfo)->ai_addr,
        (int)((struct addrinfo*)csock->_SocketInfo)->ai_addrlen, nullptr, nullptr, nullptr, nullptr) < 0) {
        exception[NetException::Error] << "Socket connect: can't connect to server aborting " << " ErrorMsg:" << GetLastError();
        throw exception;
    }

    if (::getpeername(_Socket, ((struct addrinfo*)_SocketInfo)->ai_addr, (int*)&((struct addrinfo*)_SocketInfo)->ai_addrlen) < 0) {
        NetException exception;
        exception[NetException::Error] << "Connect: getpeername failed on " << (int)_Socket << " error code : " << GetLastError();