summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp')
-rw-r--r--Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
index b99aec5..0a856f9 100644
--- a/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
+++ b/Documentation/SwiftenDevelopersGuide/Examples/EchoBot/EchoComponent.cpp
@@ -14,8 +14,8 @@ using namespace boost;
class EchoComponent {
public:
- EchoComponent(EventLoop* eventLoop) {
- component = new Component(eventLoop, JID("echo.wonderland.lit"), "EchoSecret");
+ EchoComponent(EventLoop* eventLoop, NetworkFactories* networkFactories) {
+ component = new Component(eventLoop, networkFactories, JID("echo.wonderland.lit"), "EchoSecret");
component->onConnected.connect(bind(&EchoComponent::handleConnected, this));
component->onMessageReceived.connect(
bind(&EchoComponent::handleMessageReceived, this, _1));
@@ -58,7 +58,10 @@ class EchoComponent {
int main(int, char**) {
SimpleEventLoop eventLoop;
- EchoComponent bot(&eventLoop);
+ BoostNetworkFactories networkFactories(&eventLoop);
+
+ EchoComponent bot(&eventLoop, &networkFactories);
+
eventLoop.run();
return 0;
}