diff options
Diffstat (limited to 'src/libjin/Net/Socket.h')
-rw-r--r-- | src/libjin/Net/Socket.h | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/libjin/Net/Socket.h b/src/libjin/Net/Socket.h index 32ef86f..ad2ce60 100644 --- a/src/libjin/Net/Socket.h +++ b/src/libjin/Net/Socket.h @@ -7,55 +7,55 @@ namespace jin { -namespace net -{ - - enum SocketType - { - TCP, - UDP - }; - - struct SocketInformation - { - unsigned int address; - unsigned short port; - SocketType type; - }; - - 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); - 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(); + namespace net + { + + enum SocketType + { + TCP, + UDP + }; + + struct SocketInformation + { + unsigned int address; + unsigned short port; + SocketType type; + }; + + 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); + 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 LIBJIN_NET_TEKCOS - Socket(const tk_TCPsocket& tcpHandle); - Socket(const tk_UDPsocket& udpHandle); - union - { - tk_TCPsocket tcpHandle; - tk_UDPsocket udpHandle; - } handle; - #endif - SocketType type; - - }; - -} // net + protected: + #if LIBJIN_NET_TEKCOS + Socket(const tk_TCPsocket& tcpHandle); + Socket(const tk_UDPsocket& udpHandle); + union + { + tk_TCPsocket tcpHandle; + tk_UDPsocket udpHandle; + } handle; + #endif + SocketType type; + + }; + + } // net } // jin #endif // LIBJIN_MODULES_NET |