diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-17 19:24:15 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-01-17 19:24:15 +0100 |
commit | 67bf2f66dd46409d2f5c91f187d496aacadaeced (patch) | |
tree | 5a59af42e99f1ffb6f48477170a7a6ebab8aa0b4 /src/StatsServer.h | |
parent | e6a0ca2d1442eb6a9e54fe631652c7ac8066d6ba (diff) | |
download | dabmux-67bf2f66dd46409d2f5c91f187d496aacadaeced.tar.gz dabmux-67bf2f66dd46409d2f5c91f187d496aacadaeced.tar.bz2 dabmux-67bf2f66dd46409d2f5c91f187d496aacadaeced.zip |
StatsServer corrections
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; |