Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/netclient.h')
-rw-r--r--src/core/netclient.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/core/netclient.h b/src/core/netclient.h
index c0cdf8d..818422e 100644
--- a/src/core/netclient.h
+++ b/src/core/netclient.h
@@ -43,14 +43,14 @@ namespace core
class NetClient
{
public:
- NetClient(std::string host, int port, int fd);
- ~NetClient();
+ NetClient(std::string host, int port, int fd);
+ ~NetClient();
- /// the remote hostname the client is connected to
- std::string host() const;
+ /// the remote hostname the client is connected to
+ std::string host() const;
- /// the remote port the client is connected to
- int port() const;
+ /// the remote port the client is connected to
+ int port() const;
/// the player info associated with this client
Player *player();
@@ -69,32 +69,38 @@ public:
/// transmit messages in the send queue to the remote client
void transmit();
-
- inline bool error() const { return client_error; }
+
+ inline bool error() const {
+ return client_error;
+ }
void abort();
- enum State {Connecting=0, Pending=1, Connected=2};
+ enum State {Connecting = 0, Pending = 1, Connected = 2};
+
+ inline State state() const {
+ return client_state;
+ }
- inline State state() const { return client_state; }
-
State client_state;
-
+
float client_timeout;
float client_keepalive;
private:
- inline int fd() const { return client_fd; }
+ inline int fd() const {
+ return client_fd;
+ }
struct sockaddr_in client_addr;
- std::string client_host;
- int client_port;
+ std::string client_host;
+ int client_port;
int client_fd;
bool client_error;
NetPlayer *client_player;
-
- std::string messageblock;
+
+ std::string messageblock;
std::deque<std::string> recvq;
std::string sendq;
};