diff options
Diffstat (limited to 'src/Net/ClientConnection.h')
-rw-r--r-- | src/Net/ClientConnection.h | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/Net/ClientConnection.h b/src/Net/ClientConnection.h index c738b1e..18b1a02 100644 --- a/src/Net/ClientConnection.h +++ b/src/Net/ClientConnection.h @@ -30,44 +30,25 @@ class IPAddress; class ClientConnection : public Connection { private: - bool connected; - IPAddress *peer; - - bool connecting; - - int sock; - gnutls_session_t session; gnutls_anon_client_credentials_t anoncred; - void sendConnectionHeader(bool daemon); + bool daemon; + void connectionHeaderReceiveHandler(const void *data, unsigned long length); protected: - virtual gnutls_session_t& getSession() { - return session; - } + virtual void connectionHeader(); public: - ClientConnection() : connected(false), connecting(false) { + ClientConnection() : daemon(0) { gnutls_anon_allocate_client_credentials(&anoncred); } virtual ~ClientConnection() { - if(connected) - disconnect(); - gnutls_anon_free_client_credentials(anoncred); } - void connect(const IPAddress &address, bool daemon = false) throw(ConnectionException); - void disconnect(); - - virtual bool dataPending() const; - - virtual bool isConnected() const {return connected;} - virtual const IPAddress* getPeer() const {return peer;} - - virtual bool isConnecting() const {return connecting;} + void connect(const IPAddress &address, bool daemon0 = false) throw(ConnectionException); }; } |