summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-08-14 08:49:36 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-08-16 22:13:25 (GMT)
commit9f1c6250b4e0859b1436f669a51b8b58b2428bd0 (patch)
treeb7246f0055230ca336ddcb21b3f30778f496a08d
parent3e984e93df6673c7f3750e220b0cb2364c2f3279 (diff)
downloadswift-9f1c6250b4e0859b1436f669a51b8b58b2428bd0.zip
swift-9f1c6250b4e0859b1436f669a51b8b58b2428bd0.tar.bz2
Use global IO service thread in Client.
-rw-r--r--Limber/main.cpp2
-rw-r--r--Swiften/Client/Client.cpp4
-rw-r--r--Swiften/Client/Client.h4
3 files changed, 5 insertions, 5 deletions
diff --git a/Limber/main.cpp b/Limber/main.cpp
index 686df3c..965abc2 100644
--- a/Limber/main.cpp
+++ b/Limber/main.cpp
@@ -24,7 +24,7 @@ using namespace Swift;
class Server {
public:
Server(UserRegistry* userRegistry) : userRegistry_(userRegistry) {
- serverFromClientConnectionServer_ = boost::shared_ptr<BoostConnectionServer>(new BoostConnectionServer(5224, &boostIOServiceThread_.getIOService()));
+ serverFromClientConnectionServer_ = boost::shared_ptr<BoostConnectionServer>(new BoostConnectionServer(5222, &boostIOServiceThread_.getIOService()));
serverFromClientConnectionServer_->onNewConnection.connect(boost::bind(&Server::handleNewConnection, this, _1));
serverFromClientConnectionServer_->start();
}
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 95f6c0f..5d04a92 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -3,6 +3,8 @@
#include <boost/bind.hpp>
#include "Swiften/Network/DomainNameResolver.h"
+#include "Swiften/Network/MainBoostIOServiceThread.h"
+#include "Swiften/Network/BoostIOServiceThread.h"
#include "Swiften/Client/ClientSession.h"
#include "Swiften/StreamStack/PlatformTLSLayerFactory.h"
#include "Swiften/Network/BoostConnectionFactory.h"
@@ -13,7 +15,7 @@ namespace Swift {
Client::Client(const JID& jid, const String& password) :
IQRouter(this), jid_(jid), password_(password) {
- connectionFactory_ = new BoostConnectionFactory(&boostIOServiceThread_.getIOService());
+ connectionFactory_ = new BoostConnectionFactory(&MainBoostIOServiceThread::getInstance().getIOService());
tlsLayerFactory_ = new PlatformTLSLayerFactory();
}
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index 1561c75..516bee2 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -15,14 +15,13 @@
#include "Swiften/Queries/IQRouter.h"
#include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h"
#include "Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h"
-#include "Swiften/Network/BoostIOServiceThread.h"
namespace Swift {
class TLSLayerFactory;
class ConnectionFactory;
class ClientSession;
- class Client : public StanzaChannel, public IQRouter {
+ class Client : public StanzaChannel, public IQRouter, public boost::bsignals::trackable {
public:
Client(const JID& jid, const String& password);
~Client();
@@ -53,7 +52,6 @@ namespace Swift {
void handleDataWritten(const ByteArray&);
private:
- BoostIOServiceThread boostIOServiceThread_;
JID jid_;
String password_;
IDGenerator idGenerator_;