diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2017-04-16 22:00:46 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2017-04-16 22:00:46 +0200 |
| commit | 33f81a3a57a047326160f371f3269dfb47c59cba (patch) | |
| tree | dc6e39bca104d7d440f19ae0d663b42afea2835f /statsd/stats.cpp | |
| parent | d680f8d3848cbc3adf7d6b2c49e10abc4499cfca (diff) | |
| download | cmix-33f81a3a57a047326160f371f3269dfb47c59cba.tar.gz cmix-33f81a3a57a047326160f371f3269dfb47c59cba.tar.bz2 cmix-33f81a3a57a047326160f371f3269dfb47c59cba.zip | |
Some cleanup and tweaked the statsd slightly.
Diffstat (limited to 'statsd/stats.cpp')
| -rw-r--r-- | statsd/stats.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/statsd/stats.cpp b/statsd/stats.cpp index e2a6a5d..a448449 100644 --- a/statsd/stats.cpp +++ b/statsd/stats.cpp @@ -6,9 +6,6 @@ void Stats::accept_connection(std::unique_ptr<boost::asio::ip::tcp::socket>&& so auto it = connections.emplace(connections.end(), std::move(socket)); it->on_done([this, it](){ connections.erase(it); - if(connections.empty()) { - server.close(); - } }); it->async_receive([it, this](cmix_proto::CMixMessage const& message) { handle_message(it, message); @@ -44,8 +41,8 @@ void Stats::handle_message(std::list<Receiver>::iterator it, cmix_proto::CMixMes } } -Stats::Stats(ListenSettings lsettings) -: io_service() +Stats::Stats(boost::asio::io_service& io_service, ListenSettings lsettings) +: io_service(io_service) , server(io_service, lsettings, [this](std::unique_ptr<boost::asio::ip::tcp::socket>&& socket){accept_connection(std::move(socket));}) {} |
