summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Network/ConnectionServer.cpp8
-rw-r--r--Swiften/Network/ConnectionServer.h15
-rw-r--r--Swiften/Network/IncomingConnection.cpp8
-rw-r--r--Swiften/Network/IncomingConnection.h17
-rw-r--r--Swiften/Network/Makefile.inc2
5 files changed, 50 insertions, 0 deletions
diff --git a/Swiften/Network/ConnectionServer.cpp b/Swiften/Network/ConnectionServer.cpp
new file mode 100644
index 0000000..7f63fee
--- /dev/null
+++ b/Swiften/Network/ConnectionServer.cpp
@@ -0,0 +1,8 @@
+#include "Swiften/Network/ConnectionServer.h"
+
+namespace Swift {
+
+ConnectionServer::~ConnectionServer() {
+}
+
+}
diff --git a/Swiften/Network/ConnectionServer.h b/Swiften/Network/ConnectionServer.h
new file mode 100644
index 0000000..d376308
--- /dev/null
+++ b/Swiften/Network/ConnectionServer.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <boost/shared_ptr.hpp>
+#include <boost/signal.hpp>
+
+#include "Swiften/Network/IncomingConnection.h"
+
+namespace Swift {
+ class ConnectionServer {
+ public:
+ virtual ~ConnectionServer();
+
+ boost::signal<void (boost::shared_ptr<IncomingConnection>)> onNewConnection;
+ };
+}
diff --git a/Swiften/Network/IncomingConnection.cpp b/Swiften/Network/IncomingConnection.cpp
new file mode 100644
index 0000000..669f68e
--- /dev/null
+++ b/Swiften/Network/IncomingConnection.cpp
@@ -0,0 +1,8 @@
+#include "Swiften/Network/IncomingConnection.h"
+
+namespace Swift {
+
+IncomingConnection::~IncomingConnection() {
+}
+
+}
diff --git a/Swiften/Network/IncomingConnection.h b/Swiften/Network/IncomingConnection.h
new file mode 100644
index 0000000..eaa2ad6
--- /dev/null
+++ b/Swiften/Network/IncomingConnection.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include <boost/signal.hpp>
+
+#include "Swiften/Base/ByteArray.h"
+
+namespace Swift {
+ class IncomingConnection {
+ public:
+ virtual ~IncomingConnection();
+
+ virtual void write(const ByteArray& data) = 0;
+
+ //boost::signal<void (Error)> onError;
+ boost::signal<void (const ByteArray&)> onDataRead;
+ };
+}
diff --git a/Swiften/Network/Makefile.inc b/Swiften/Network/Makefile.inc
index 17b2838..b0f0fd1 100644
--- a/Swiften/Network/Makefile.inc
+++ b/Swiften/Network/Makefile.inc
@@ -4,6 +4,8 @@ SWIFTEN_SOURCES += \
Swiften/Network/ConnectionFactory.cpp \
Swiften/Network/BoostConnection.cpp \
Swiften/Network/BoostConnectionFactory.cpp \
+ Swiften/Network/ConnectionServer.cpp \
+ Swiften/Network/IncomingConnection.cpp \
Swiften/Network/Timer.cpp
include Swiften/Network/UnitTest/Makefile.inc