summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/Server/IncomingConnection.cpp8
-rw-r--r--Swiften/Server/IncomingConnection.h24
-rw-r--r--Swiften/Server/Makefile.inc3
3 files changed, 34 insertions, 1 deletions
diff --git a/Swiften/Server/IncomingConnection.cpp b/Swiften/Server/IncomingConnection.cpp
new file mode 100644
index 0000000..e2317c8
--- /dev/null
+++ b/Swiften/Server/IncomingConnection.cpp
@@ -0,0 +1,8 @@
+#include "Swiften/Server/IncomingConnection.h"
+
+namespace Swift {
+
+IncomingConnection::~IncomingConnection() {
+}
+
+}
diff --git a/Swiften/Server/IncomingConnection.h b/Swiften/Server/IncomingConnection.h
new file mode 100644
index 0000000..6ef64e8
--- /dev/null
+++ b/Swiften/Server/IncomingConnection.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <boost/signals.hpp>
+
+#include "Swiften/Base/ByteArray.h"
+#include "Swiften/Base/String.h"
+
+namespace Swift {
+ class IncomingConnection {
+ public:
+ enum Error {
+ ConnectionError,
+ ReadError
+ };
+
+ virtual ~IncomingConnection();
+
+ virtual void write(const ByteArray& data) = 0;
+
+ public:
+ boost::signal<void (Error)> onError;
+ boost::signal<void (const ByteArray&)> onDataRead;
+ };
+}
diff --git a/Swiften/Server/Makefile.inc b/Swiften/Server/Makefile.inc
index 8dd6051..54f09ce 100644
--- a/Swiften/Server/Makefile.inc
+++ b/Swiften/Server/Makefile.inc
@@ -1,5 +1,6 @@
SWIFTEN_SOURCES += \
Swiften/Server/ServerSession.cpp \
- Swiften/Server/ServerStanzaRouter.cpp
+ Swiften/Server/ServerStanzaRouter.cpp \
+ Swiften/Server/IncomingConnection.cpp
include Swiften/Server/UnitTest/Makefile.inc