summaryrefslogtreecommitdiffstats
path: root/src/Net/Connection.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-06-12 19:17:28 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-06-12 19:17:28 +0200
commit4b0778537ea5f1c4d7592639208e7c235abab260 (patch)
treee294a0c4753bea89692694434be2353ea205c66e /src/Net/Connection.h
parent5679977b5d22e22be9e4c47c4a3dcab90c1bc5a4 (diff)
downloadmad-4b0778537ea5f1c4d7592639208e7c235abab260.tar
mad-4b0778537ea5f1c4d7592639208e7c235abab260.zip
Recieve-Funktion hinzugef?gt (ungetestet)
Diffstat (limited to 'src/Net/Connection.h')
-rw-r--r--src/Net/Connection.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Net/Connection.h b/src/Net/Connection.h
index 6e8d8de..1879f9e 100644
--- a/src/Net/Connection.h
+++ b/src/Net/Connection.h
@@ -21,6 +21,7 @@
#define MAD_NET_CONNECTION_H_
#include <gnutls/gnutls.h>
+#include "Packet.h"
namespace Mad {
namespace Net {
@@ -29,16 +30,24 @@ class IPAddress;
class Packet;
class Connection {
+ private:
+ Packet::Data header;
+ unsigned char *data;
+
+ unsigned long read;
+
protected:
virtual gnutls_session_t& getSession() = 0;
public:
- virtual ~Connection() {}
+ Connection() : data(0), read(0) {}
+ virtual ~Connection() {if(data) delete [] data;}
virtual bool isConnected() const = 0;
virtual const IPAddress* getPeer() const = 0;
bool send(const Packet &packet);
+ bool recieve();
static void init() {
gnutls_global_init();