From 4b0778537ea5f1c4d7592639208e7c235abab260 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 12 Jun 2008 19:17:28 +0200 Subject: Recieve-Funktion hinzugef?gt (ungetestet) --- src/Net/Connection.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Net/Connection.h') 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 +#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(); -- cgit v1.2.3