diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-01-26 18:36:30 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-01-26 18:36:30 (GMT) |
commit | 256f9df327d13447ec110bbaebe813b86e57a610 (patch) | |
tree | da58c29d58b3695406fc323ebc54483c0978d536 /Slimber | |
parent | c27c75917aea053baaa884638a3c056666a05602 (diff) | |
download | swift-contrib-256f9df327d13447ec110bbaebe813b86e57a610.zip swift-contrib-256f9df327d13447ec110bbaebe813b86e57a610.tar.bz2 |
Make boost io_service a shared object.
This should avoid problems when destroying an event loop containing
timer or network events, after the network factory (and io_service
object) has disappeared (i.e. at shutdown).
Diffstat (limited to 'Slimber')
-rw-r--r-- | Slimber/Server.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp index c6e700e..b8cffb0 100644 --- a/Slimber/Server.cpp +++ b/Slimber/Server.cpp @@ -59,7 +59,7 @@ Server::~Server() { void Server::start() { assert(!serverFromClientConnectionServer); serverFromClientConnectionServer = BoostConnectionServer::create( - clientConnectionPort, &boostIOServiceThread.getIOService(), eventLoop); + clientConnectionPort, boostIOServiceThread.getIOService(), eventLoop); serverFromClientConnectionServerSignalConnections.push_back( serverFromClientConnectionServer->onNewConnection.connect( boost::bind(&Server::handleNewClientConnection, this, _1))); @@ -69,7 +69,7 @@ void Server::start() { assert(!serverFromNetworkConnectionServer); serverFromNetworkConnectionServer = BoostConnectionServer::create( - linkLocalConnectionPort, &boostIOServiceThread.getIOService(), eventLoop); + linkLocalConnectionPort, boostIOServiceThread.getIOService(), eventLoop); serverFromNetworkConnectionServerSignalConnections.push_back( serverFromNetworkConnectionServer->onNewConnection.connect( boost::bind(&Server::handleNewLinkLocalConnection, this, _1))); @@ -256,7 +256,7 @@ void Server::handleElementReceived(boost::shared_ptr<Element> element, boost::sh new LinkLocalConnector( *service, linkLocalServiceBrowser->getQuerier(), - BoostConnection::create(&boostIOServiceThread.getIOService(), eventLoop))); + BoostConnection::create(boostIOServiceThread.getIOService(), eventLoop))); connector->onConnectFinished.connect( boost::bind(&Server::handleConnectFinished, this, connector, _1)); connectors.push_back(connector); |