Loading src/linux/socket.cpp +24 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,17 @@ int netplus::socket::getSocket(){ return _Socket; } netplus::tcp::tcp(netplus::tcp& ctcp){ _Socket=ctcp._Socket; if(_UxPath.empty()) _SocketPtr=new struct sockaddr_in; else _SocketPtr=new struct sockaddr_un; memcpy(_SocketPtr,ctcp._SocketPtr,sizeof(ctcp._SocketPtr)); _SocketPtrSize=ctcp._SocketPtrSize; } netplus::tcp::tcp(const char* uxsocket,int maxconnections,int sockopts) : socket(){ NetException exception; Loading Loading @@ -242,6 +253,19 @@ void netplus::tcp::getAddress(std::string &addr){ addr=ipaddr; } netplus::udp::udp(netplus::udp& cudp){ _Socket=cudp._Socket; if(_UxPath.empty()) _SocketPtr=new struct sockaddr_in; else _SocketPtr=new struct sockaddr_un; memcpy(_SocketPtr,cudp._SocketPtr,sizeof(cudp._SocketPtr)); _SocketPtrSize=cudp._SocketPtrSize; } netplus::udp::udp(const char* uxsocket,int maxconnections,int sockopts) : socket(){ NetException exception; int optval = 1; Loading src/socket.h +2 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ namespace netplus { class tcp : public socket{ public: tcp(netplus::tcp& ctcp); tcp(const char *uxsocket,int maxconnections, int sockopts); tcp(const char *addr,int port,int maxconnections, Loading Loading @@ -92,6 +93,7 @@ namespace netplus { class udp : public socket{ public: udp(udp &cudp); udp(const char *uxsocket,int maxconnections, int sockopts); udp(const char *addr,int port,int maxconnections, Loading Loading
src/linux/socket.cpp +24 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,17 @@ int netplus::socket::getSocket(){ return _Socket; } netplus::tcp::tcp(netplus::tcp& ctcp){ _Socket=ctcp._Socket; if(_UxPath.empty()) _SocketPtr=new struct sockaddr_in; else _SocketPtr=new struct sockaddr_un; memcpy(_SocketPtr,ctcp._SocketPtr,sizeof(ctcp._SocketPtr)); _SocketPtrSize=ctcp._SocketPtrSize; } netplus::tcp::tcp(const char* uxsocket,int maxconnections,int sockopts) : socket(){ NetException exception; Loading Loading @@ -242,6 +253,19 @@ void netplus::tcp::getAddress(std::string &addr){ addr=ipaddr; } netplus::udp::udp(netplus::udp& cudp){ _Socket=cudp._Socket; if(_UxPath.empty()) _SocketPtr=new struct sockaddr_in; else _SocketPtr=new struct sockaddr_un; memcpy(_SocketPtr,cudp._SocketPtr,sizeof(cudp._SocketPtr)); _SocketPtrSize=cudp._SocketPtrSize; } netplus::udp::udp(const char* uxsocket,int maxconnections,int sockopts) : socket(){ NetException exception; int optval = 1; Loading
src/socket.h +2 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ namespace netplus { class tcp : public socket{ public: tcp(netplus::tcp& ctcp); tcp(const char *uxsocket,int maxconnections, int sockopts); tcp(const char *addr,int port,int maxconnections, Loading Loading @@ -92,6 +93,7 @@ namespace netplus { class udp : public socket{ public: udp(udp &cudp); udp(const char *uxsocket,int maxconnections, int sockopts); udp(const char *addr,int port,int maxconnections, Loading