Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
committerStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
commitf030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch)
treecd92baf9e4fa8a136523b9eb570e9811846c9250 /src/core/netconnection.h
parent5636fad174f0bcff857c357c394c4cc8d424b302 (diff)
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/core/netconnection.h')
-rw-r--r--src/core/netconnection.h52
1 files changed, 35 insertions, 17 deletions
diff --git a/src/core/netconnection.h b/src/core/netconnection.h
index 7c0b23d..36cf154 100644
--- a/src/core/netconnection.h
+++ b/src/core/netconnection.h
@@ -41,10 +41,10 @@ class NetConnection
public:
NetConnection();
virtual ~NetConnection();
-
+
/// connect to a remote host
virtual void connect(std::string const &to_host, int to_port);
-
+
/// disconnect from a remote host
virtual void disconnect();
@@ -80,28 +80,46 @@ public:
void abort();
- inline int fd() const { return connection_fd; }
-
- inline std::string host() const { return connection_host; }
+ inline int fd() const {
+ return connection_fd;
+ }
+
+ inline std::string host() const {
+ return connection_host;
+ }
- inline int port() const { return connection_port; }
+ inline int port() const {
+ return connection_port;
+ }
- inline bool valid() const { return (connection_fd != -1); }
+ inline bool valid() const {
+ return (connection_fd != -1);
+ }
- inline bool invalid() const { return (connection_fd == -1); }
+ inline bool invalid() const {
+ return (connection_fd == -1);
+ }
- inline bool error() const { return connection_error; }
+ inline bool error() const {
+ return connection_error;
+ }
- inline bool connected() const { return ((connection_fd != -1) && !connection_error); }
+ inline bool connected() const {
+ return ((connection_fd != -1) && !connection_error);
+ }
- enum State {Connecting=0, Pending=1, Connected=2};
+ enum State {Connecting = 0, Pending = 1, Connected = 2};
+
+ inline State state() const {
+ return connection_state;
+ }
- inline State state() const { return connection_state; }
-
State connection_state;
/// return the current game time
- inline unsigned long timestamp() const { return connection_timestamp; }
+ inline unsigned long timestamp() const {
+ return connection_timestamp;
+ }
protected:
/// send a ping reply
@@ -121,13 +139,13 @@ protected:
/// parse an incoming message
void parse_incoming_message(const std::string & message);
-
+
private:
- std::string messageblock;
+ std::string messageblock;
std::deque<std::string> recvq;
std::string sendq;
fd_set clientset;
-
+
float connection_timeout;
float connection_keepalive;
int connection_fd;