diff options
Diffstat (limited to 'src/lua/net/lua_net_Socket.h')
-rw-r--r-- | src/lua/net/lua_net_Socket.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/lua/net/lua_net_Socket.h b/src/lua/net/lua_net_Socket.h new file mode 100644 index 0000000..e02fb5b --- /dev/null +++ b/src/lua/net/lua_net_Socket.h @@ -0,0 +1,64 @@ +#ifndef __JIN_LUA_NET_SOCKET_H +#define __JIN_LUA_NET_SOCKET_H +#include "libjin/jin.h" +#include "../luaopen_types.h" + +namespace jin +{ +namespace lua +{ +namespace net +{ + + class Socket : public jin::net::Socket + , public Object + { + public: + typedef jin::net::SocketInformation SocketInformation; + typedef jin::net::SocketType SocketType; + + Socket(jin::net::Socket base) + : jin::net::Socket(base) + { + } + + Socket(const SocketInformation& socketInformation) + : jin::net::Socket(socketInformation) + { + } + + Socket(SocketType type, unsigned short port) + : jin::net::Socket(type, port) + { + } + + Socket(SocketType type, unsigned int address, unsigned short port) + : jin::net::Socket(type, address) + { + } + + Socket(SocketType type, const char* address, unsigned short port) + : jin::net::Socket(type, address, port) + { + } + + Socket * accept() + { + jin::net::Socket* base = jin::net::Socket::accept(); + Socket* socket = new Socket(*base); + delete base; + return socket; + } + + private: + ~Socket() + { + } + + }; + +} +} +} + +#endif
\ No newline at end of file |