diff options
Diffstat (limited to 'src/Net/Connection.h')
-rw-r--r-- | src/Net/Connection.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Net/Connection.h b/src/Net/Connection.h index 42e0c8e..381ed17 100644 --- a/src/Net/Connection.h +++ b/src/Net/Connection.h @@ -60,6 +60,18 @@ class Connection { } protected: + struct ConnectionHeader { + unsigned char m; + unsigned char a; + unsigned char d; + unsigned char type; + + unsigned char versionMajor; + unsigned char versionMinor; + unsigned char protVerMin; + unsigned char protVerMax; + }; + virtual gnutls_session_t& getSession() = 0; bool rawReceive(unsigned long length, @@ -90,9 +102,14 @@ class Connection { virtual bool isConnected() const = 0; virtual const IPAddress* getPeer() const = 0; + virtual bool isConnecting() const = 0; + virtual bool dataPending() const = 0; bool send(const Packet &packet) { + if(isConnecting()) + return false; + return rawSend(reinterpret_cast<const unsigned char*>(packet.getRawData()), packet.getRawDataLength()); } |