summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-15 22:09:20 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-16 07:16:37 (GMT)
commit999f19158672bd6c91fa274a9f8e968b84f8a931 (patch)
treecbcf864514c0abc71414d187f6810619bbf0fea9 /Swiften/Examples/SendMessage
parent0f4fad3929097dca24d1ca92b06283811661e1f4 (diff)
downloadswift-999f19158672bd6c91fa274a9f8e968b84f8a931.zip
swift-999f19158672bd6c91fa274a9f8e968b84f8a931.tar.bz2
Pass NetworkFactories as an explicit dependency into client.
Diffstat (limited to 'Swiften/Examples/SendMessage')
-rw-r--r--Swiften/Examples/SendMessage/SendMessage.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/Examples/SendMessage/SendMessage.cpp b/Swiften/Examples/SendMessage/SendMessage.cpp
index 567a351..8e28dab 100644
--- a/Swiften/Examples/SendMessage/SendMessage.cpp
+++ b/Swiften/Examples/SendMessage/SendMessage.cpp
@@ -8,16 +8,16 @@
#include <boost/thread.hpp>
#include "Swiften/Client/Client.h"
-#include "Swiften/Network/BoostTimer.h"
+#include "Swiften/Network/BoostNetworkFactories.h"
+#include "Swiften/Network/TimerFactory.h"
#include "Swiften/EventLoop/EventLoop.h"
#include "Swiften/Client/ClientXMLTracer.h"
#include "Swiften/EventLoop/SimpleEventLoop.h"
-#include "Swiften/Network/BoostIOServiceThread.h"
-#include "Swiften/Network/MainBoostIOServiceThread.h"
using namespace Swift;
SimpleEventLoop eventLoop;
+BoostNetworkFactories networkFactories(&eventLoop);
Client* client = 0;
JID recipient;
@@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {
connectHost = argv[argi++];
}
- client = new Swift::Client(&eventLoop, JID(jid), String(argv[argi++]));
+ client = new Swift::Client(&eventLoop, &networkFactories, JID(jid), String(argv[argi++]));
client->setAlwaysTrustCertificates();
recipient = JID(argv[argi++]);
@@ -73,7 +73,7 @@ int main(int argc, char* argv[]) {
}
{
- BoostTimer::ref timer(BoostTimer::create(30000, &MainBoostIOServiceThread::getInstance().getIOService(), &eventLoop));
+ Timer::ref timer = networkFactories.getTimerFactory()->createTimer(30000);
timer->onTick.connect(boost::bind(&SimpleEventLoop::stop, &eventLoop));
timer->start();