Loading src/posix/tcp.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -151,7 +151,11 @@ int netplus::tcp::getMaxconnections(){ void netplus::tcp::accept(socket *csock){ NetException exception; *csock=::accept(_Socket,(struct sockaddr*)((struct addrinfo *)csock->_SocketInfo)->ai_addr,&((struct addrinfo*)csock->_SocketInfo)->ai_addrlen); copyAddrInfo(&csock->_SocketInfo,_SocketInfo); socklen_t len=0; *csock=::accept(_Socket,(struct sockaddr*)((struct addrinfo *)csock->_SocketInfo)->ai_addr,&len); if(csock->_Socket<0){ int etype=NetException::Error; Loading Loading @@ -266,6 +270,5 @@ void netplus::tcp::getAddress(std::string &addr){ if(!_SocketInfo) return; char ipaddr[INET6_ADDRSTRLEN]; inet_ntop(((struct addrinfo*)_SocketInfo)->ai_family,((struct addrinfo*)_SocketInfo)->ai_addr, ipaddr, ((struct addrinfo*)_SocketInfo)->ai_addrlen); addr=ipaddr; addr=inet_ntop(((struct addrinfo*)_SocketInfo)->ai_family,((struct addrinfo*)_SocketInfo)->ai_addr, ipaddr, ((struct addrinfo*)_SocketInfo)->ai_addrlen); } Loading
src/posix/tcp.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -151,7 +151,11 @@ int netplus::tcp::getMaxconnections(){ void netplus::tcp::accept(socket *csock){ NetException exception; *csock=::accept(_Socket,(struct sockaddr*)((struct addrinfo *)csock->_SocketInfo)->ai_addr,&((struct addrinfo*)csock->_SocketInfo)->ai_addrlen); copyAddrInfo(&csock->_SocketInfo,_SocketInfo); socklen_t len=0; *csock=::accept(_Socket,(struct sockaddr*)((struct addrinfo *)csock->_SocketInfo)->ai_addr,&len); if(csock->_Socket<0){ int etype=NetException::Error; Loading Loading @@ -266,6 +270,5 @@ void netplus::tcp::getAddress(std::string &addr){ if(!_SocketInfo) return; char ipaddr[INET6_ADDRSTRLEN]; inet_ntop(((struct addrinfo*)_SocketInfo)->ai_family,((struct addrinfo*)_SocketInfo)->ai_addr, ipaddr, ((struct addrinfo*)_SocketInfo)->ai_addrlen); addr=ipaddr; addr=inet_ntop(((struct addrinfo*)_SocketInfo)->ai_family,((struct addrinfo*)_SocketInfo)->ai_addr, ipaddr, ((struct addrinfo*)_SocketInfo)->ai_addrlen); }