aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Net/je_socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Net/je_socket.h')
-rw-r--r--src/libjin/Net/je_socket.h84
1 files changed, 83 insertions, 1 deletions
diff --git a/src/libjin/Net/je_socket.h b/src/libjin/Net/je_socket.h
index 5a31683..cfe904f 100644
--- a/src/libjin/Net/je_socket.h
+++ b/src/libjin/Net/je_socket.h
@@ -10,12 +10,18 @@ namespace JinEngine
namespace Net
{
+ ///
+ ///
+ ///
enum SocketType
{
TCP,
UDP
};
+ ///
+ ///
+ ///
struct SocketInformation
{
unsigned int address;
@@ -23,34 +29,109 @@ namespace JinEngine
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;
};
@@ -59,4 +140,5 @@ namespace JinEngine
} // namespace JinEngine
#endif // LIBJIN_MODULES_NET
-#endif // __JE_NET_SOCKET_H
+
+#endif // __JE_NET_SOCKET_H \ No newline at end of file