projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.
[dcpomatic.git]
/
src
/
lib
/
server_finder.h
diff --git
a/src/lib/server_finder.h
b/src/lib/server_finder.h
index 04a7786cf4442a255268660a93a9673626f4dcc8..202bee8f920d9610bd82c50b6951ea701199ed25 100644
(file)
--- a/
src/lib/server_finder.h
+++ b/
src/lib/server_finder.h
@@
-20,20
+20,28
@@
#include <boost/signals2.hpp>
#include "server.h"
#include <boost/signals2.hpp>
#include "server.h"
-class ServerFinder
+class ServerFinder
: public ExceptionStore
{
public:
void connect (boost::function<void (ServerDescription)>);
static ServerFinder* instance ();
{
public:
void connect (boost::function<void (ServerDescription)>);
static ServerFinder* instance ();
+ void disable () {
+ _disabled = true;
+ }
+
private:
ServerFinder ();
void broadcast_thread ();
void listen_thread ();
private:
ServerFinder ();
void broadcast_thread ();
void listen_thread ();
+ bool server_found (std::string) const;
+
boost::signals2::signal<void (ServerDescription)> ServerFound;
boost::signals2::signal<void (ServerDescription)> ServerFound;
+
+ bool _disabled;
/** Thread to periodically issue broadcasts to find encoding servers */
boost::thread* _broadcast_thread;
/** Thread to periodically issue broadcasts to find encoding servers */
boost::thread* _broadcast_thread;
@@
-41,7
+49,7
@@
private:
boost::thread* _listen_thread;
std::list<ServerDescription> _servers;
boost::thread* _listen_thread;
std::list<ServerDescription> _servers;
- boost::mutex _mutex;
+
mutable
boost::mutex _mutex;
static ServerFinder* _instance;
};
static ServerFinder* _instance;
};