summaryrefslogtreecommitdiff
path: root/src/lib/server_finder.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-29 19:54:07 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-29 19:54:07 +0000
commit00ee110ef1de083759c4f74bdfeff78752b6198f (patch)
treee342f557344ad7bdea4b0b6a6af5e44d858bcfcf /src/lib/server_finder.h
parentf213fd833a840fc97e3875979ae7dc7cbbc883b1 (diff)
Make ServerFinder stop nicely when dcpomatic_cli quits.
Diffstat (limited to 'src/lib/server_finder.h')
-rw-r--r--src/lib/server_finder.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/server_finder.h b/src/lib/server_finder.h
index 6f02042ce..c0f1feb66 100644
--- a/src/lib/server_finder.h
+++ b/src/lib/server_finder.h
@@ -26,6 +26,7 @@ public:
void connect (boost::function<void (ServerDescription)>);
static ServerFinder* instance ();
+ static void drop ();
void disable () {
_disabled = true;
@@ -33,11 +34,14 @@ public:
private:
ServerFinder ();
+ ~ServerFinder ();
void broadcast_thread ();
void listen_thread ();
bool server_found (std::string) const;
+ void start_accept ();
+ void handle_accept (boost::system::error_code ec, boost::shared_ptr<Socket> socket);
boost::signals2::signal<void (ServerDescription)> ServerFound;
@@ -51,5 +55,9 @@ private:
std::list<ServerDescription> _servers;
mutable boost::mutex _mutex;
+ boost::asio::io_service _listen_io_service;
+ boost::shared_ptr<boost::asio::ip::tcp::acceptor> _listen_acceptor;
+ bool _stop;
+
static ServerFinder* _instance;
};