aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/net/socket.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-02-11 11:29:07 +0800
committerchai <chaifix@163.com>2020-02-11 11:29:07 +0800
commit160e1299ef3d95f8e8c48706d7f61dd3dc6c6b60 (patch)
treeabe5ae5242d9cc6caf6edf103e662c44e978fca0 /src/libjin/net/socket.h
parente095043485d1d298571af6d9eca7f0db9009ea7a (diff)
*修改 tab大小HEADmaster
Diffstat (limited to 'src/libjin/net/socket.h')
-rw-r--r--src/libjin/net/socket.h260
1 files changed, 130 insertions, 130 deletions
diff --git a/src/libjin/net/socket.h b/src/libjin/net/socket.h
index 1562272..4a65245 100644
--- a/src/libjin/net/socket.h
+++ b/src/libjin/net/socket.h
@@ -9,136 +9,136 @@
namespace JinEngine
{
- namespace Net
- {
-
- ///
- ///
- ///
- enum SocketType
- {
- TCP,
- UDP
- };
-
- ///
- ///
- ///
- struct SocketInformation
- {
- unsigned int address;
- unsigned short port;
- SocketType type;
- };
-
- ///
- ///
- ///
- class Socket : public Object
- {
- 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);
-
- ///
- ///
- ///
- Socket(SocketType type, const char* address, unsigned short port);
-
- ///
- ///
- ///
- ~Socket();
-
- ///
- ///
- ///
- void configureBlocking(bool bocking);
-
- ///
- ///
- ///
- Socket* accept();
-
- ///
- ///
- ///
- int receive(char* buffer, int size);
-
- ///
- ///
- ///
- int send(char* buffer, int size);
-
- ///
- ///
- ///
- void sendTo(char* buffer, int size, unsigned int address, unsigned int port);
-
- ///
- ///
- ///
- int receiveFrom(char* buffer, int size, unsigned int address, unsigned int port);
-
- ///
- ///
- ///
- void close();
-
- protected:
- #if jin_net == jin_net_tekcos
-
- ///
- ///
- ///
- Socket(const tk_TCPsocket& tcpHandle);
-
- ///
- ///
- ///
- Socket(const tk_UDPsocket& udpHandle);
-
- ///
- ///
- ///
- union
- {
- tk_TCPsocket tcpHandle;
- tk_UDPsocket udpHandle;
- } mHandle;
- #endif
-
- ///
- ///
- ///
- SocketType mType;
-
- };
-
- } // namespace Net
+ namespace Net
+ {
+
+ ///
+ ///
+ ///
+ enum SocketType
+ {
+ TCP,
+ UDP
+ };
+
+ ///
+ ///
+ ///
+ struct SocketInformation
+ {
+ unsigned int address;
+ unsigned short port;
+ SocketType type;
+ };
+
+ ///
+ ///
+ ///
+ class Socket : public Object
+ {
+ 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);
+
+ ///
+ ///
+ ///
+ Socket(SocketType type, const char* address, unsigned short port);
+
+ ///
+ ///
+ ///
+ ~Socket();
+
+ ///
+ ///
+ ///
+ void configureBlocking(bool bocking);
+
+ ///
+ ///
+ ///
+ Socket* accept();
+
+ ///
+ ///
+ ///
+ int receive(char* buffer, int size);
+
+ ///
+ ///
+ ///
+ int send(char* buffer, int size);
+
+ ///
+ ///
+ ///
+ void sendTo(char* buffer, int size, unsigned int address, unsigned int port);
+
+ ///
+ ///
+ ///
+ int receiveFrom(char* buffer, int size, unsigned int address, unsigned int port);
+
+ ///
+ ///
+ ///
+ void close();
+
+ protected:
+ #if jin_net == jin_net_tekcos
+
+ ///
+ ///
+ ///
+ Socket(const tk_TCPsocket& tcpHandle);
+
+ ///
+ ///
+ ///
+ Socket(const tk_UDPsocket& udpHandle);
+
+ ///
+ ///
+ ///
+ union
+ {
+ tk_TCPsocket tcpHandle;
+ tk_UDPsocket udpHandle;
+ } mHandle;
+ #endif
+
+ ///
+ ///
+ ///
+ SocketType mType;
+
+ };
+
+ } // namespace Net
} // namespace JinEngine
#endif // defined(jin_net)