diff options
Diffstat (limited to 'src/lua/net/Socket.h')
-rw-r--r-- | src/lua/net/Socket.h | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/lua/net/Socket.h b/src/lua/net/Socket.h deleted file mode 100644 index f679bd1..0000000 --- a/src/lua/net/Socket.h +++ /dev/null @@ -1,77 +0,0 @@ -#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 -{ - - typedef jin::net::SocketInformation SocketInformation; - typedef jin::net::SocketType SocketType; - - class Socket : public Object - { - public: - - Socket(const SocketInformation& info) - { - socket = new jin::net::Socket(info); - } - - void configureBlocking(bool blocking) - { - socket->configureBlocking(blocking); - } - - Socket* accept() - { - Socket* client = new Socket(); - client->socket = socket->accept(); - return client; - } - - int receive(char* buffer, int size) - { - return socket->receive(buffer, size); - } - - int send(char* buffer, int size) - { - return socket->send(buffer, size); - } - - void sendTo(char* buffer, int size, unsigned int address, unsigned int port) - { - socket->sendTo(buffer, size, address, port); - } - - int receiveFrom(char* buffer, int size, unsigned int address, unsigned int port) - { - return socket->receiveFrom(buffer, size, address, port); - } - - void close() - { - socket->close(); - } - - private: - jin::net::Socket* socket; - - Socket() {} - ~Socket() - { - delete socket; - } - - }; - -} // net -} // lua -} // jin - -#endif
\ No newline at end of file |