/* core/netclient.h This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #ifndef __INCLUDED_CORE_NETCLIENT_H__ #define __INCLUDED_CORE_NETCLIENT_H__ #include #include #include #include "net/tcpclient.h" #include "core/player.h" namespace core { /// queues incoming client messages class NetClient : public net::TCPClient { public: NetClient(int clientfd, std::string host, int port); ~NetClient(); /// the remote hostname the client is connected to std::string host() const; /// the remote port the client is connected to int port() const; /// the player info associated with this client Player *player(); /// return true if there are incoming messages bool has_messages() const; /// receive an incoming message void retreive(std::string & message); /// receive incoming data and store messages void receive(); private: std::string client_host; int client_port; Player client_player; std::string sendq; std::string messageblock; std::deque recvq; }; } #endif // __INCLUDED_CORE_NETCLIENT_H__