Commit 88415f3d authored by jan.koester's avatar jan.koester
Browse files

new operator

parent 3107bf05
Loading
Loading
Loading
Loading
+16 −0
Changes for src/linux/socket.cpp: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -200,6 +200,12 @@ int netplus::tcp::fd(){
    return _Socket;
}

netplus::tcp& netplus::tcp::operator=(int sock){
     _Socket=sock;
     return *this;
};


int netplus::tcp::getMaxconnections(){
    return _Maxconnections;
}
@@ -441,6 +447,11 @@ int netplus::udp::fd(){
    return _Socket;
}

netplus::udp& netplus::udp::operator=(int sock){
     _Socket=sock;
     return *this;
};

int netplus::udp::getMaxconnections(){
    return _Maxconnections;
}
@@ -871,6 +882,11 @@ void netplus::ssl::listen(){
    return;
}

netplus::ssl& netplus::ssl::operator=(int sock){
     ((SSLPrivate*)_SSLPrivate)->_Socket.fd=sock;
     return *this;
};

int netplus::ssl::fd(){
    return ((SSLPrivate*)_SSLPrivate)->_Socket.fd;
}
+5 −1
Changes for src/socket.h: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ namespace netplus {

            virtual int          fd()=0;

	    virtual socket&	 operator=(int sock)=0;

            void               *_SocketPtr;
            unsigned int        _SocketPtrSize;
            int                 _Socket;
@@ -79,6 +81,7 @@ namespace netplus {
            void          bind();
            void          listen();
            int           fd();
            tcp&          operator=(int socket);

            int           getMaxconnections();
            
@@ -111,6 +114,7 @@ namespace netplus {
            void          bind();
            void          listen();
            int           fd();
            udp&          operator=(int socket);

            int           getMaxconnections();

@@ -143,7 +147,7 @@ namespace netplus {
            void          bind();
            void          listen();
            int           fd();

            ssl&          operator=(int socket);
            int           getMaxconnections();
            
            unsigned int sendData(socket *socket,void *data,unsigned long size);