summaryrefslogtreecommitdiffstats
path: root/src/Net/Listener.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Net/Listener.cpp')
-rw-r--r--src/Net/Listener.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Net/Listener.cpp b/src/Net/Listener.cpp
index be227fd..6da2762 100644
--- a/src/Net/Listener.cpp
+++ b/src/Net/Listener.cpp
@@ -39,8 +39,8 @@ void Listener::handleAccept(const boost::system::error_code &error, boost::share
con->_setState(Connection::CONNECT);
- boost::signals::connection con1 = con->signalConnected().connect(boost::bind(&Listener::handleConnect, this, con));
- boost::signals::connection con2 = con->signalDisconnected().connect(boost::bind(&Listener::handleDisconnect, this, con));
+ Signals::Connection con1 = con->connectSignalConnected(boost::bind(&Listener::handleConnect, this, con));
+ Signals::Connection con2 = con->connectSignalDisconnected(boost::bind(&Listener::handleDisconnect, this, con));
connections.insert(std::make_pair(con, std::make_pair(con1, con2)));
@@ -54,18 +54,19 @@ void Listener::handleAccept(const boost::system::error_code &error, boost::share
void Listener::handleConnect(boost::shared_ptr<Connection> con) {
{
boost::lock_guard<boost::mutex> lock(mutex);
- std::map<boost::shared_ptr<Connection>, std::pair<boost::signals::connection, boost::signals::connection> >::iterator it = connections.find(con);
+ std::map<boost::shared_ptr<Connection>, std::pair<Signals::Connection, Signals::Connection> >::iterator it = connections.find(con);
if(it == connections.end())
return;
// Disconnect signal handlers
- it->second.first.disconnect();
- it->second.second.disconnect();
+
+ con->disconnectSignalConnected(it->second.first);
+ con->disconnectSignalDisconnected(it->second.second);
connections.erase(it);
}
- signal(con);
+ signal.emit(con);
}
void Listener::handleDisconnect(boost::shared_ptr<Connection> con) {
@@ -92,7 +93,7 @@ sslContext(Connection::ioService, boost::asio::ssl::context::sslv23)
}
Listener::~Listener() {
- for(std::map<boost::shared_ptr<Connection>,std::pair<boost::signals::connection, boost::signals::connection> >::iterator con = connections.begin(); con != connections.end(); ++con) {
+ for(std::map<boost::shared_ptr<Connection>,std::pair<Signals::Connection, Signals::Connection> >::iterator con = connections.begin(); con != connections.end(); ++con) {
con->first->disconnect();
// TODO wait...
}