Loading src/event/epoll.cpp +2 −5 Changes for src/event/epoll.cpp: 2 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -103,8 +103,6 @@ namespace netplus { ~poll() { for (int i = 0; i <_ServerSocket->getMaxconnections(); ++i){ if(_Events[i].data.ptr) delete static_cast<con*>(_Events[i].data.ptr)->csock; delete static_cast<con*>(_Events[i].data.ptr); } }; Loading Loading @@ -164,9 +162,9 @@ namespace netplus { evconnection->CreateConnection(&ccon); if(_ServerSocket->_Type==sockettype::TCP){ ccon->csock=new tcp(-1); ccon->csock=std::make_shared<tcp>(-1); }else if(_ServerSocket->_Type==sockettype::UDP){ ccon->csock=new udp( -1); ccon->csock=std::make_shared<udp>(-1); }else if(_ServerSocket->_Type==sockettype::SSL){ // clt->connection->csock=std::make_shared<ssl>( -1); } Loading Loading @@ -280,7 +278,6 @@ namespace netplus { throw except; } evconnection->DisconnectEvent(*ccon,tid,args); delete ccon->csock; evconnection->DestroyConnection(ccon); _Events[pos].data.ptr=nullptr; Loading src/posix/tcp.cpp +4 −4 Changes for src/posix/tcp.cpp: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ int netplus::tcp::getMaxconnections(){ return _Maxconnections; } void netplus::tcp::accept(socket *csock){ void netplus::tcp::accept(std::shared_ptr<socket> &csock){ NetException exception; copyAddrInfo(&csock->_SocketInfo,_SocketInfo,_SocketInfoLen); Loading Loading @@ -241,10 +241,10 @@ size_t netplus::tcp::recvData(buffer &data,int flags){ return (size_t)recvsize != 0 ? recvsize : data.size; } void netplus::tcp::connect(socket *ssock){ void netplus::tcp::connect(std::shared_ptr<socket> &csock){ NetException exception; copyAddrInfo(&_SocketInfo,ssock->_SocketInfo, ssock->_SocketInfoLen); copyAddrInfo(&_SocketInfo,csock->_SocketInfo, csock->_SocketInfoLen); if( (_Socket=::socket(((struct addrinfo*)_SocketInfo)->ai_family,SOCK_STREAM,0) ) < 0 ){ NetException exception; Loading @@ -254,7 +254,7 @@ void netplus::tcp::connect(socket *ssock){ throw exception; } if ( ::connect(_Socket,((struct addrinfo*)ssock->_SocketInfo)->ai_addr,((struct addrinfo*)ssock->_SocketInfo)->ai_addrlen) < 0) { if ( ::connect(_Socket,((struct addrinfo*)csock->_SocketInfo)->ai_addr,((struct addrinfo*)csock->_SocketInfo)->ai_addrlen) < 0) { char errstr[512]; strerror_r_netplus(errno,errstr,512); Loading src/posix/udp.cpp +4 −4 Changes for src/posix/udp.cpp: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ int netplus::udp::getMaxconnections(){ return _Maxconnections; } void netplus::udp::accept(socket *csock){ void netplus::udp::accept(std::shared_ptr<socket> &csock){ NetException exception; ((struct addrinfo *)(csock->_SocketInfo))->ai_addr=(struct sockaddr*) malloc(((struct addrinfo *)(_SocketInfo))->ai_addrlen); Loading Loading @@ -241,10 +241,10 @@ size_t netplus::udp::recvData(buffer &data,int flags){ return (size_t)recvsize != 0 ? recvsize : data.size; } void netplus::udp::connect(socket *ssock){ void netplus::udp::connect(std::shared_ptr<socket> &csock){ NetException exception; copyAddrInfo(&_SocketInfo,ssock->_SocketInfo,ssock->_SocketInfoLen); copyAddrInfo(&_SocketInfo,csock->_SocketInfo,csock->_SocketInfoLen); if( (_Socket=::socket(((struct addrinfo*)_SocketInfo)->ai_family,SOCK_DGRAM,0) ) < 0 ){ NetException exception; Loading @@ -254,7 +254,7 @@ void netplus::udp::connect(socket *ssock){ throw exception; } if ( ::connect(_Socket,((struct addrinfo*)ssock->_SocketInfo)->ai_addr,((struct addrinfo*)ssock->_SocketInfo)->ai_addrlen) < 0) { if ( ::connect(_Socket,((struct addrinfo*)csock->_SocketInfo)->ai_addr,((struct addrinfo*)csock->_SocketInfo)->ai_addrlen) < 0) { char errstr[512]; strerror_r_netplus(errno,errstr,512); Loading Loading
src/event/epoll.cpp +2 −5 Changes for src/event/epoll.cpp: 2 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -103,8 +103,6 @@ namespace netplus { ~poll() { for (int i = 0; i <_ServerSocket->getMaxconnections(); ++i){ if(_Events[i].data.ptr) delete static_cast<con*>(_Events[i].data.ptr)->csock; delete static_cast<con*>(_Events[i].data.ptr); } }; Loading Loading @@ -164,9 +162,9 @@ namespace netplus { evconnection->CreateConnection(&ccon); if(_ServerSocket->_Type==sockettype::TCP){ ccon->csock=new tcp(-1); ccon->csock=std::make_shared<tcp>(-1); }else if(_ServerSocket->_Type==sockettype::UDP){ ccon->csock=new udp( -1); ccon->csock=std::make_shared<udp>(-1); }else if(_ServerSocket->_Type==sockettype::SSL){ // clt->connection->csock=std::make_shared<ssl>( -1); } Loading Loading @@ -280,7 +278,6 @@ namespace netplus { throw except; } evconnection->DisconnectEvent(*ccon,tid,args); delete ccon->csock; evconnection->DestroyConnection(ccon); _Events[pos].data.ptr=nullptr; Loading
src/posix/tcp.cpp +4 −4 Changes for src/posix/tcp.cpp: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ int netplus::tcp::getMaxconnections(){ return _Maxconnections; } void netplus::tcp::accept(socket *csock){ void netplus::tcp::accept(std::shared_ptr<socket> &csock){ NetException exception; copyAddrInfo(&csock->_SocketInfo,_SocketInfo,_SocketInfoLen); Loading Loading @@ -241,10 +241,10 @@ size_t netplus::tcp::recvData(buffer &data,int flags){ return (size_t)recvsize != 0 ? recvsize : data.size; } void netplus::tcp::connect(socket *ssock){ void netplus::tcp::connect(std::shared_ptr<socket> &csock){ NetException exception; copyAddrInfo(&_SocketInfo,ssock->_SocketInfo, ssock->_SocketInfoLen); copyAddrInfo(&_SocketInfo,csock->_SocketInfo, csock->_SocketInfoLen); if( (_Socket=::socket(((struct addrinfo*)_SocketInfo)->ai_family,SOCK_STREAM,0) ) < 0 ){ NetException exception; Loading @@ -254,7 +254,7 @@ void netplus::tcp::connect(socket *ssock){ throw exception; } if ( ::connect(_Socket,((struct addrinfo*)ssock->_SocketInfo)->ai_addr,((struct addrinfo*)ssock->_SocketInfo)->ai_addrlen) < 0) { if ( ::connect(_Socket,((struct addrinfo*)csock->_SocketInfo)->ai_addr,((struct addrinfo*)csock->_SocketInfo)->ai_addrlen) < 0) { char errstr[512]; strerror_r_netplus(errno,errstr,512); Loading
src/posix/udp.cpp +4 −4 Changes for src/posix/udp.cpp: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ int netplus::udp::getMaxconnections(){ return _Maxconnections; } void netplus::udp::accept(socket *csock){ void netplus::udp::accept(std::shared_ptr<socket> &csock){ NetException exception; ((struct addrinfo *)(csock->_SocketInfo))->ai_addr=(struct sockaddr*) malloc(((struct addrinfo *)(_SocketInfo))->ai_addrlen); Loading Loading @@ -241,10 +241,10 @@ size_t netplus::udp::recvData(buffer &data,int flags){ return (size_t)recvsize != 0 ? recvsize : data.size; } void netplus::udp::connect(socket *ssock){ void netplus::udp::connect(std::shared_ptr<socket> &csock){ NetException exception; copyAddrInfo(&_SocketInfo,ssock->_SocketInfo,ssock->_SocketInfoLen); copyAddrInfo(&_SocketInfo,csock->_SocketInfo,csock->_SocketInfoLen); if( (_Socket=::socket(((struct addrinfo*)_SocketInfo)->ai_family,SOCK_DGRAM,0) ) < 0 ){ NetException exception; Loading @@ -254,7 +254,7 @@ void netplus::udp::connect(socket *ssock){ throw exception; } if ( ::connect(_Socket,((struct addrinfo*)ssock->_SocketInfo)->ai_addr,((struct addrinfo*)ssock->_SocketInfo)->ai_addrlen) < 0) { if ( ::connect(_Socket,((struct addrinfo*)csock->_SocketInfo)->ai_addr,((struct addrinfo*)csock->_SocketInfo)->ai_addrlen) < 0) { char errstr[512]; strerror_r_netplus(errno,errstr,512); Loading