diff options
author | chai <chaifix@163.com> | 2018-12-14 14:55:42 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-14 14:55:42 +0800 |
commit | 870fcdae66edc680cac55defb149e1434e865f37 (patch) | |
tree | bb0b45627b98ec4c782466b3bb57daf63c44e460 /src/libjin/net/je_socket.h | |
parent | eb8ca083c9be574acd27cf0de41d1f69146cad7a (diff) |
*格式化代码
Diffstat (limited to 'src/libjin/net/je_socket.h')
-rw-r--r-- | src/libjin/net/je_socket.h | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/src/libjin/net/je_socket.h b/src/libjin/net/je_socket.h index 4e7faa8..00e91de 100644 --- a/src/libjin/net/je_socket.h +++ b/src/libjin/net/je_socket.h @@ -9,136 +9,136 @@ namespace JinEngine { - namespace Net - { + namespace Net + { /// /// /// - enum SocketType - { - TCP, - UDP - }; + enum SocketType + { + TCP, + UDP + }; /// /// /// - struct SocketInformation - { - unsigned int address; - unsigned short port; - SocketType type; - }; + struct SocketInformation + { + unsigned int address; + unsigned short port; + SocketType type; + }; /// /// /// - class Socket : public Object - { - public: + class Socket : public Object + { + public: /// /// /// - Socket() {}; + Socket() {}; /// /// /// - Socket(const Socket& socket); + Socket(const Socket& socket); /// /// /// - Socket(const SocketInformation& socketInformation); + Socket(const SocketInformation& socketInformation); /// /// /// - Socket(SocketType type, unsigned short port); + Socket(SocketType type, unsigned short port); /// /// /// - Socket(SocketType type, unsigned int address, unsigned short port); + Socket(SocketType type, unsigned int address, unsigned short port); /// /// /// - Socket(SocketType type, const char* address, unsigned short port); + Socket(SocketType type, const char* address, unsigned short port); /// /// /// - ~Socket(); + ~Socket(); /// /// /// - void configureBlocking(bool bocking); + void configureBlocking(bool bocking); /// /// /// - Socket* accept(); + Socket* accept(); /// /// /// - int receive(char* buffer, int size); + int receive(char* buffer, int size); /// /// /// - int send(char* buffer, int size); + int send(char* buffer, int size); /// /// /// - void sendTo(char* buffer, int size, unsigned int address, unsigned int port); + void sendTo(char* buffer, int size, unsigned int address, unsigned int port); /// /// /// - int receiveFrom(char* buffer, int size, unsigned int address, unsigned int port); + int receiveFrom(char* buffer, int size, unsigned int address, unsigned int port); /// /// /// - void close(); + void close(); - protected: - #if jin_net == jin_net_tekcos + protected: + #if jin_net == jin_net_tekcos /// /// /// - Socket(const tk_TCPsocket& tcpHandle); + Socket(const tk_TCPsocket& tcpHandle); /// /// /// - Socket(const tk_UDPsocket& udpHandle); + Socket(const tk_UDPsocket& udpHandle); /// /// /// - union - { - tk_TCPsocket tcpHandle; - tk_UDPsocket udpHandle; - } mHandle; - #endif + union + { + tk_TCPsocket tcpHandle; + tk_UDPsocket udpHandle; + } mHandle; + #endif /// /// /// - SocketType mType; + SocketType mType; - }; + }; - } // namespace Net + } // namespace Net } // namespace JinEngine #endif // defined(jin_net) |