From 5162f84be0a4deb447c6ba1226722b049335d525 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 14 Aug 2018 09:26:22 +0800 Subject: *update --- src/libjin/Net/Socket.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/libjin/Net/Socket.h') diff --git a/src/libjin/Net/Socket.h b/src/libjin/Net/Socket.h index eb00605..720113e 100644 --- a/src/libjin/Net/Socket.h +++ b/src/libjin/Net/Socket.h @@ -26,6 +26,8 @@ namespace net class Socket { public: + Socket() {}; + Socket(const Socket& socket); Socket(const SocketInformation& socketInformation); Socket(SocketType type, unsigned short port); Socket(SocketType type, unsigned int address, unsigned short port); @@ -40,13 +42,16 @@ namespace net int receiveFrom(char* buffer, int size, unsigned int address, unsigned int port); void close(); - private: + protected: #if JIN_NET_TEKCOS - Socket(tk_TCPsocket* tcpHandle); - Socket(tk_UDPsocket* udpHandle); - tk_TCPsocket* tcpHandle; - tk_UDPsocket* udpHandle; - #endif + Socket(tk_TCPsocket tcpHandle); + Socket(tk_UDPsocket udpHandle); + union + { + tk_TCPsocket tcpHandle; + tk_UDPsocket udpHandle; + } handle; + #endif SocketType type; }; -- cgit v1.1-26-g67d0