summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-12 17:57:48 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-12 18:49:51 (GMT)
commit72858ab262a16aa8db209c2898ab0d3c951a9829 (patch)
tree411ccedbf9bdd746ccb1f124e74fe91111d63a56 /Swiften/StreamStack/IncomingConnectionLayer.h
parenteb1338be843c53aa02fac0d38455aada3f89db0b (diff)
downloadswift-contrib-72858ab262a16aa8db209c2898ab0d3c951a9829.zip
swift-contrib-72858ab262a16aa8db209c2898ab0d3c951a9829.tar.bz2
Added ServerFromClientSession.
Diffstat (limited to 'Swiften/StreamStack/IncomingConnectionLayer.h')
-rw-r--r--Swiften/StreamStack/IncomingConnectionLayer.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Swiften/StreamStack/IncomingConnectionLayer.h b/Swiften/StreamStack/IncomingConnectionLayer.h
new file mode 100644
index 0000000..c1a9eab
--- /dev/null
+++ b/Swiften/StreamStack/IncomingConnectionLayer.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <boost/signal.hpp>
+
+#include "Swiften/StreamStack/LowLayer.h"
+#include "Swiften/Network/IncomingConnection.h"
+
+namespace Swift {
+ class IncomingConnectionLayer : public LowLayer {
+ public:
+ IncomingConnectionLayer(IncomingConnection* connection) : connection_(connection) {
+ connection_->onDataRead.connect(onDataRead);
+ }
+
+ void writeData(const ByteArray& data) {
+ connection_->write(data);
+ }
+
+ private:
+ IncomingConnection* connection_;
+ };
+}