Commit 4af9f4db authored by jan.koester's avatar jan.koester
Browse files

fixed

parent a66ac552
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -123,7 +123,6 @@ netplus::tcp::tcp(const char* addr, int port,int maxconnections,int sockopts) :
}

netplus::tcp::~tcp(){
    if(!_Copy)
    ::close(_Socket);
    ::free(_SocketPtr);
}
@@ -134,7 +133,6 @@ netplus::tcp::tcp() : socket() {
    ((struct sockaddr*)_SocketPtr)->sa_family=AF_UNSPEC;
    _Socket=::socket(((struct sockaddr*)_SocketPtr)->sa_family,SOCK_STREAM,0);
    _Type=sockettype::TCP;
    _Copy=false;
}

netplus::tcp::tcp(SOCKET sock) : socket(){
@@ -143,16 +141,6 @@ netplus::tcp::tcp(SOCKET sock) : socket(){
     ((struct sockaddr*)_SocketPtr)->sa_family=AF_UNSPEC;
    _Socket=sock;
    _Type=sockettype::TCP;
    _Copy=false;
}

netplus::tcp::tcp(const netplus::tcp& ctcp) : socket (){
    _SocketPtr=::malloc(sizeof(ctcp));
    _SocketPtrSize=sizeof(ctcp);
     ((struct sockaddr*)_SocketPtr)->sa_family=((struct sockaddr*)ctcp._SocketPtr)->sa_family;
    _Socket=ctcp._Socket;
    _Type=sockettype::TCP;
    _Copy=true;
}

void netplus::tcp::listen(){
+1 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ namespace netplus {
        public:
            tcp();
            tcp(SOCKET socket);
            tcp(const netplus::tcp& ctcp);
            tcp(const netplus::tcp& ctcp) = delete;
            tcp(const char *uxsocket,int maxconnections,
                int sockopts);
            tcp(const char *addr,int port,int maxconnections,
@@ -108,7 +108,6 @@ namespace netplus {
        private:
            int             _Maxconnections;
            std::string     _UxPath;
            bool            _Copy;
        };
        
        class udp : public socket{
+1 −14
Original line number Diff line number Diff line
@@ -100,7 +100,6 @@ netplus::tcp::tcp(const char* addr, int port,int maxconnections,int sockopts) :
}

netplus::tcp::~tcp(){
    if(!_Copy)
    ::closesocket(_Socket);
    ::free(_SocketPtr);
}
@@ -111,7 +110,6 @@ netplus::tcp::tcp() : socket() {
    ((struct sockaddr*)_SocketPtr)->sa_family=AF_UNSPEC;
    _Socket=::socket(((struct sockaddr*)_SocketPtr)->sa_family,SOCK_STREAM,0);
    _Type=sockettype::TCP;
    _Copy=false;
}

netplus::tcp::tcp(SOCKET sock) : socket() {
@@ -120,19 +118,8 @@ netplus::tcp::tcp(SOCKET sock) : socket() {
     ((struct addrinfo*)_SocketPtr)->ai_family=AF_UNSPEC;
    _Socket=sock;
    _Type=sockettype::TCP;
    _Copy=false;
}

netplus::tcp::tcp(const netplus::tcp& ctcp) : socket (){
    _SocketPtr=::malloc(sizeof(ctcp));
    _SocketPtrSize=sizeof(ctcp);
     ((struct addrinfo*)_SocketPtr)->ai_family=((struct addrinfo*)ctcp._SocketPtr)->ai_family;
    _Socket=ctcp._Socket;
    _Type=sockettype::TCP;
    _Copy=true;
}


void netplus::tcp::listen(){
    NetException exception;
    if(::listen(_Socket,_Maxconnections) < 0){