summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@sakuya.local>2010-11-07 22:08:13 +0100
committerVegard Storheil Eriksen <zyp@sakuya.local>2010-11-07 22:08:13 +0100
commit7c660aeee9763a6baf4a45ebcc1c029e3a43222e (patch)
treeba712dcc0e6e20735ea61d89ee09ce10a76811b6 /common
parent362a71f445f218b1d54576989c88ad450c9e5905 (diff)
Add connectionbase destructor printing diagnostic message.
Diffstat (limited to 'common')
-rw-r--r--common/connectionbase.cpp7
-rw-r--r--common/connectionbase.h2
2 files changed, 6 insertions, 3 deletions
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 <iostream>
-#include <string>
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