diff options
Diffstat (limited to 'src/StatsServer.h')
-rw-r--r-- | src/StatsServer.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/StatsServer.h b/src/StatsServer.h index 76ca497..5bbf327 100644 --- a/src/StatsServer.h +++ b/src/StatsServer.h @@ -84,7 +84,18 @@ class StatsServer m_listenport(listen_port), m_running(true), m_thread(&StatsServer::serverThread, this) - {} + { + m_sock = 0; + } + + ~StatsServer() + { + m_running = false; + if (m_sock) { + close(m_sock); + } + m_thread.join(); + } void registerInput(std::string id); // The input notifies the StatsServer about a new buffer size @@ -106,6 +117,8 @@ class StatsServer bool m_running; boost::thread m_thread; + int m_sock; + /******* Statistics Data ********/ std::map<std::string, InputStat> m_inputStats; |