diff options
author | chai <chaifix@163.com> | 2018-08-14 09:26:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-14 09:26:22 +0800 |
commit | 5162f84be0a4deb447c6ba1226722b049335d525 (patch) | |
tree | 5f7ed0ddc05b1499eaf0607b88fd5cb5e2a961c1 /src/libjin/Net/Socket.h | |
parent | 636e766791dc8680d237fafe4ff6dd904e16a860 (diff) |
*update
Diffstat (limited to 'src/libjin/Net/Socket.h')
-rw-r--r-- | src/libjin/Net/Socket.h | 17 |
1 files changed, 11 insertions, 6 deletions
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; }; |