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

fixed

parent 2bf8d5e6
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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);
}