From 7c660aeee9763a6baf4a45ebcc1c029e3a43222e Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 7 Nov 2010 22:08:13 +0100 Subject: Add connectionbase destructor printing diagnostic message. --- common/connectionbase.cpp | 7 ++++--- common/connectionbase.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/connectionbase.cpp b/common/connectionbase.cpp index c744646..23860d2 100644 --- a/common/connectionbase.cpp +++ b/common/connectionbase.cpp @@ -1,7 +1,6 @@ #include "connectionbase.h" #include -#include void ConnectionBase::prepare_next_message() { next_message = Message::create(); @@ -12,8 +11,6 @@ void ConnectionBase::prepare_next_message() { void ConnectionBase::connected() { std::cout << "Connection established." << std::endl; - write_data((uint8_t*)"Hei!\n", 5); - prepare_next_message(); } @@ -45,3 +42,7 @@ Message::p ConnectionBase::recv() { return msg; } + +ConnectionBase::~ConnectionBase() { + std::cout << "Connection destroyed." << std::endl; +} diff --git a/common/connectionbase.h b/common/connectionbase.h index 8bd56e9..13721dc 100644 --- a/common/connectionbase.h +++ b/common/connectionbase.h @@ -40,6 +40,8 @@ class ConnectionBase { //! Get received message or null if queue empty. Message::p recv(); + + virtual ~ConnectionBase(); }; #endif -- cgit v1.2.3