#include <boost/signals2.hpp>
#include "server.h"
-class ServerFinder
+class ServerFinder : public ExceptionStore
{
public:
void connect (boost::function<void (ServerDescription)>);
static ServerFinder* instance ();
+ void disable () {
+ _disabled = true;
+ }
+
private:
ServerFinder ();
void broadcast_thread ();
void listen_thread ();
+ bool server_found (std::string) const;
+
boost::signals2::signal<void (ServerDescription)> ServerFound;
+
+ bool _disabled;
/** Thread to periodically issue broadcasts to find encoding servers */
boost::thread* _broadcast_thread;
boost::thread* _listen_thread;
std::list<ServerDescription> _servers;
- boost::mutex _mutex;
+ mutable boost::mutex _mutex;
static ServerFinder* _instance;
};