summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-11 20:22:39 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-11 20:43:12 (GMT)
commitd0204b9e28ce7bde66da233879d5879ae1cce273 (patch)
tree4dde6cd28e4a7ffa412a354aad5e3d189e7f1ab2 /Swiften
parent69f6c80767ae1b36d8761188e02983ed4b20c371 (diff)
downloadswift-d0204b9e28ce7bde66da233879d5879ae1cce273.zip
swift-d0204b9e28ce7bde66da233879d5879ae1cce273.tar.bz2
Added IncomingConnection.
Diffstat (limited to 'Swiften')
-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