summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-14 17:27:32 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-14 17:27:32 (GMT)
commitee3a46975986865fe5064f9d87a27277fc6c235a (patch)
tree51bae2ed1669ca881f761ca7547fbaf22432ae12 /Swiften/Server
parentc34f50d3371f47c88d2ee927a5d59af8e135304c (diff)
downloadswift-contrib-ee3a46975986865fe5064f9d87a27277fc6c235a.zip
swift-contrib-ee3a46975986865fe5064f9d87a27277fc6c235a.tar.bz2
Consolidating IncomingConnection & Connection.
BoostConnections no longer have their own thread, but are managed from a central Boost IO thread instead.
Diffstat (limited to 'Swiften/Server')
-rw-r--r--Swiften/Server/IncomingConnection.cpp8
-rw-r--r--Swiften/Server/IncomingConnection.h24
-rw-r--r--Swiften/Server/Makefile.inc1
-rw-r--r--Swiften/Server/ServerFromClientSession.cpp8
-rw-r--r--Swiften/Server/ServerFromClientSession.h10
5 files changed, 9 insertions, 42 deletions
diff --git a/Swiften/Server/IncomingConnection.cpp b/Swiften/Server/IncomingConnection.cpp
deleted file mode 100644
index e2317c8..0000000
--- a/Swiften/Server/IncomingConnection.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "Swiften/Server/IncomingConnection.h"
-
-namespace Swift {
-
-IncomingConnection::~IncomingConnection() {
-}
-
-}
diff --git a/Swiften/Server/IncomingConnection.h b/Swiften/Server/IncomingConnection.h
deleted file mode 100644
index 6ef64e8..0000000
--- a/Swiften/Server/IncomingConnection.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#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 ae10bd2..ae38335 100644
--- a/Swiften/Server/Makefile.inc
+++ b/Swiften/Server/Makefile.inc
@@ -2,7 +2,6 @@ SWIFTEN_SOURCES += \
Swiften/Server/ServerSession.cpp \
Swiften/Server/ServerFromClientSession.cpp \
Swiften/Server/ServerStanzaRouter.cpp \
- Swiften/Server/IncomingConnection.cpp \
Swiften/Server/UserRegistry.cpp \
Swiften/Server/SimpleUserRegistry.cpp
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp
index e6ba28a..612e667 100644
--- a/Swiften/Server/ServerFromClientSession.cpp
+++ b/Swiften/Server/ServerFromClientSession.cpp
@@ -3,9 +3,9 @@
#include <boost/bind.hpp>
#include "Swiften/Server/UserRegistry.h"
-#include "Swiften/Network/IncomingConnection.h"
+#include "Swiften/Network/Connection.h"
#include "Swiften/StreamStack/StreamStack.h"
-#include "Swiften/StreamStack/IncomingConnectionLayer.h"
+#include "Swiften/StreamStack/ConnectionLayer.h"
#include "Swiften/StreamStack/XMPPLayer.h"
#include "Swiften/Elements/StreamFeatures.h"
#include "Swiften/Elements/ResourceBind.h"
@@ -20,7 +20,7 @@ namespace Swift {
ServerFromClientSession::ServerFromClientSession(
const String& id,
- boost::shared_ptr<IncomingConnection> connection,
+ boost::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
UserRegistry* userRegistry) :
@@ -42,7 +42,7 @@ ServerFromClientSession::ServerFromClientSession(
boost::bind(boost::ref(onDataRead), _1));
xmppLayer_->onWriteData.connect(
boost::bind(boost::ref(onDataWritten), _1));
- connectionLayer_ = new IncomingConnectionLayer(connection_.get());
+ connectionLayer_ = new ConnectionLayer(connection_.get());
streamStack_ = new StreamStack(xmppLayer_, connectionLayer_);
}
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index 6c74093..9c37b3d 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -14,15 +14,15 @@ namespace Swift {
class StreamStack;
class UserRegistry;
class XMPPLayer;
- class IncomingConnectionLayer;
- class IncomingConnection;
+ class ConnectionLayer;
+ class Connection;
class ByteArray;
class ServerFromClientSession {
public:
ServerFromClientSession(
const String& id,
- boost::shared_ptr<IncomingConnection> connection,
+ boost::shared_ptr<Connection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
UserRegistry* userRegistry);
@@ -49,13 +49,13 @@ namespace Swift {
private:
String id_;
- boost::shared_ptr<IncomingConnection> connection_;
+ boost::shared_ptr<Connection> connection_;
PayloadParserFactoryCollection* payloadParserFactories_;
PayloadSerializerCollection* payloadSerializers_;
UserRegistry* userRegistry_;
bool authenticated_;
bool initialized_;
- IncomingConnectionLayer* connectionLayer_;
+ ConnectionLayer* connectionLayer_;
StreamStack* streamStack_;
XMPPLayer* xmppLayer_;
JID domain_;