diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-06 16:43:01 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-06 16:43:01 +0000 |
| commit | 59602b67d0637817a156b7bd0fc05f96fe41dee5 (patch) | |
| tree | 3214f9f260796cf673c8bc69b069fd63b8a0889c /src/lib/server_finder.h | |
| parent | 4c7416beb0efbf74868f756ddf8013f93c5841dc (diff) | |
Various bits of server tidying up.
Diffstat (limited to 'src/lib/server_finder.h')
| -rw-r--r-- | src/lib/server_finder.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/server_finder.h b/src/lib/server_finder.h index 8b56022de..04a7786cf 100644 --- a/src/lib/server_finder.h +++ b/src/lib/server_finder.h @@ -23,19 +23,25 @@ class ServerFinder { public: - ServerFinder (); - ~ServerFinder (); + void connect (boost::function<void (ServerDescription)>); - boost::signals2::signal<void (ServerDescription)> ServerFound; + static ServerFinder* instance (); private: + ServerFinder (); + void broadcast_thread (); void listen_thread (); + + boost::signals2::signal<void (ServerDescription)> ServerFound; - /** A thread to periodically issue broadcasts to find encoding servers */ + /** Thread to periodically issue broadcasts to find encoding servers */ boost::thread* _broadcast_thread; + /** Thread to listen to the responses from servers */ boost::thread* _listen_thread; - bool _terminate; + std::list<ServerDescription> _servers; boost::mutex _mutex; + + static ServerFinder* _instance; }; |
