Loading src/posix/socket.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -106,12 +106,12 @@ void netplus::socket::setTimeout(int sec){ void netplus::socket::copyAddrInfo(ULONG_PTR *dest, ULONG_PTR src){ memcpy((void*)*(dest), (void*)src, sizeof(struct addrinfo)); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr=(struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr, ((struct addrinfo*)*dest)->ai_addr = (struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*dest)->ai_addr, (void*)((struct addrinfo*)src)->ai_addr, ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen ); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen=((struct addrinfo*)src)->ai_addrlen; ((struct addrinfo*)*dest)->ai_addrlen = ((struct addrinfo*)src)->ai_addrlen; } Loading src/windows/socket.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -87,10 +87,10 @@ SOCKET netplus::socket::fd() { void netplus::socket::copyAddrInfo(ULONG_PTR *dest, ULONG_PTR src){ memcpy((void*)*(dest),(void*)src,sizeof(struct addrinfo)); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr=(struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr, ((struct addrinfo*)*dest)->ai_addr=(struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*dest)->ai_addr, (void*)((struct addrinfo*)src)->ai_addr, ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen ); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen=((struct addrinfo*)src)->ai_addrlen; ((struct addrinfo*)*dest)->ai_addrlen=((struct addrinfo*)src)->ai_addrlen; } src/windows/tcp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -222,9 +222,9 @@ void netplus::tcp::connect(socket *ssock){ copyAddrInfo(&_SocketInfo,ssock->_SocketInfo); std::cout << ((struct addrinfo*)_SocketInfo)->ai_socktype << std::endl; std::cout << ((struct addrinfo*)ssock->_SocketInfo)->ai_addr << ": " << (int)((struct addrinfo*)ssock->_SocketInfo)->ai_addrlen << std::endl; if( (_Socket=::WSASocketW(((struct addrinfo*)_SocketInfo)->ai_family, ((struct addrinfo*)_SocketInfo)->ai_socktype, if( (_Socket=::WSASocket(((struct addrinfo*)_SocketInfo)->ai_family, ((struct addrinfo*)_SocketInfo)->ai_socktype, ((struct addrinfo*)_SocketInfo)->ai_protocol, nullptr, 0, WSA_FLAG_OVERLAPPED)) < 0 ){ NetException exception; exception[NetException::Error] << "Create Socket " << (int) _Socket << " failed : " << GetLastError(); Loading src/windows/udp.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ extern "C" { netplus::udp::udp(const char* uxsocket, int maxconnections, int sockopts) : socket() { NetException exception; exception[NetException::Critical] << "tcp: Windows doesn't support UnixSockets !"; exception[NetException::Critical] << "udp: Windows doesn't support UnixSockets !"; throw exception; } Loading Loading
src/posix/socket.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -106,12 +106,12 @@ void netplus::socket::setTimeout(int sec){ void netplus::socket::copyAddrInfo(ULONG_PTR *dest, ULONG_PTR src){ memcpy((void*)*(dest), (void*)src, sizeof(struct addrinfo)); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr=(struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr, ((struct addrinfo*)*dest)->ai_addr = (struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*dest)->ai_addr, (void*)((struct addrinfo*)src)->ai_addr, ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen ); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen=((struct addrinfo*)src)->ai_addrlen; ((struct addrinfo*)*dest)->ai_addrlen = ((struct addrinfo*)src)->ai_addrlen; } Loading
src/windows/socket.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -87,10 +87,10 @@ SOCKET netplus::socket::fd() { void netplus::socket::copyAddrInfo(ULONG_PTR *dest, ULONG_PTR src){ memcpy((void*)*(dest),(void*)src,sizeof(struct addrinfo)); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr=(struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*(struct addrinfo**)dest)->ai_addr, ((struct addrinfo*)*dest)->ai_addr=(struct sockaddr*)malloc(((struct addrinfo*)src)->ai_addrlen); memcpy((void*)((struct addrinfo*)*dest)->ai_addr, (void*)((struct addrinfo*)src)->ai_addr, ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen ); ((struct addrinfo*)*(struct addrinfo**)dest)->ai_addrlen=((struct addrinfo*)src)->ai_addrlen; ((struct addrinfo*)*dest)->ai_addrlen=((struct addrinfo*)src)->ai_addrlen; }
src/windows/tcp.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -222,9 +222,9 @@ void netplus::tcp::connect(socket *ssock){ copyAddrInfo(&_SocketInfo,ssock->_SocketInfo); std::cout << ((struct addrinfo*)_SocketInfo)->ai_socktype << std::endl; std::cout << ((struct addrinfo*)ssock->_SocketInfo)->ai_addr << ": " << (int)((struct addrinfo*)ssock->_SocketInfo)->ai_addrlen << std::endl; if( (_Socket=::WSASocketW(((struct addrinfo*)_SocketInfo)->ai_family, ((struct addrinfo*)_SocketInfo)->ai_socktype, if( (_Socket=::WSASocket(((struct addrinfo*)_SocketInfo)->ai_family, ((struct addrinfo*)_SocketInfo)->ai_socktype, ((struct addrinfo*)_SocketInfo)->ai_protocol, nullptr, 0, WSA_FLAG_OVERLAPPED)) < 0 ){ NetException exception; exception[NetException::Error] << "Create Socket " << (int) _Socket << " failed : " << GetLastError(); Loading
src/windows/udp.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ extern "C" { netplus::udp::udp(const char* uxsocket, int maxconnections, int sockopts) : socket() { NetException exception; exception[NetException::Critical] << "tcp: Windows doesn't support UnixSockets !"; exception[NetException::Critical] << "udp: Windows doesn't support UnixSockets !"; throw exception; } Loading