summaryrefslogtreecommitdiffstats
path: root/Limber
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-27 19:06:56 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-27 19:07:55 (GMT)
commit6810a2896f27e7ee07aee847f5e8dbccd1f6ec89 (patch)
treef7ea87f030e57cb4494a4f897506fb18fc3d2241 /Limber
parenta7da393cfc807048d320ddba8a1c7d24ef23a46e (diff)
downloadswift-contrib-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.zip
swift-contrib-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.tar.bz2
Remove MainEventLoop singleton.
The event loop now needs to be explicitly passed to clients using it.
Diffstat (limited to 'Limber')
-rw-r--r--Limber/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Limber/main.cpp b/Limber/main.cpp
index 45c6931..0ab4710 100644
--- a/Limber/main.cpp
+++ b/Limber/main.cpp
@@ -13,7 +13,7 @@
#include "Swiften/Elements/VCard.h"
#include "Swiften/Server/SimpleUserRegistry.h"
#include "Swiften/Base/IDGenerator.h"
-#include "Swiften/EventLoop/MainEventLoop.h"
+#include "Swiften/EventLoop/EventLoop.h"
#include "Swiften/EventLoop/SimpleEventLoop.h"
#include "Swiften/EventLoop/EventOwner.h"
#include "Swiften/Elements/Stanza.h"
@@ -29,8 +29,8 @@ using namespace Swift;
class Server {
public:
- Server(UserRegistry* userRegistry) : userRegistry_(userRegistry) {
- serverFromClientConnectionServer_ = BoostConnectionServer::create(5222, &boostIOServiceThread_.getIOService());
+ Server(UserRegistry* userRegistry, EventLoop* eventLoop) : userRegistry_(userRegistry) {
+ serverFromClientConnectionServer_ = BoostConnectionServer::create(5222, &boostIOServiceThread_.getIOService(), eventLoop);
serverFromClientConnectionServer_->onNewConnection.connect(boost::bind(&Server::handleNewConnection, this, _1));
serverFromClientConnectionServer_->start();
}
@@ -96,7 +96,7 @@ int main() {
userRegistry.addUser(JID("kevin@localhost"), "kevin");
userRegistry.addUser(JID("remko@limber.swift.im"), "remko");
userRegistry.addUser(JID("kevin@limber.swift.im"), "kevin");
- Server server(&userRegistry);
+ Server server(&userRegistry, &eventLoop);
eventLoop.run();
return 0;
}