diff options
Diffstat (limited to 'src/Net/Listener.h')
-rw-r--r-- | src/Net/Listener.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Net/Listener.h b/src/Net/Listener.h index 903c907..ec0cd22 100644 --- a/src/Net/Listener.h +++ b/src/Net/Listener.h @@ -38,9 +38,9 @@ class Listener : boost::noncopyable { boost::asio::ip::tcp::acceptor acceptor; boost::asio::ssl::context sslContext; - std::map<boost::shared_ptr<Connection>, std::pair<boost::signals::connection, boost::signals::connection> > connections; + std::map<boost::shared_ptr<Connection>, std::pair<Signals::Connection, Signals::Connection> > connections; - boost::signal1<void, boost::shared_ptr<Connection> > signal; + Signals::Signal1<void, boost::shared_ptr<Connection> > signal; void handleAccept(const boost::system::error_code &error, boost::shared_ptr<Connection> con); @@ -52,7 +52,12 @@ class Listener : boost::noncopyable { const boost::asio::ip::tcp::endpoint &address0 = boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), 6666)) throw(Exception); virtual ~Listener(); - boost::signal1<void, boost::shared_ptr<Connection> >& signalNewConnection() {return signal;} + Signals::Connection connectSignalNewConnection(const Signals::Signal1<void, boost::shared_ptr<Connection> >::slot_type &slot) { + return signal.connect(slot); + } + void disconnectSignalNewConnection(const Signals::Connection &connection) { + signal.disconnect(connection); + } }; } |