X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fencode_server_finder.h;h=abfcc6d35c5512526aec86af38aeda773007a746;hb=ec95e9c3c78112c39b67f9c61595e5b29541e7e9;hp=c639dfe3bf3aabdd641ee4295348699ca7cd2b0d;hpb=57d00c880094b1dfebaee18f4ecafb1dd44b0afb;p=dcpomatic.git diff --git a/src/lib/encode_server_finder.h b/src/lib/encode_server_finder.h index c639dfe3b..abfcc6d35 100644 --- a/src/lib/encode_server_finder.h +++ b/src/lib/encode_server_finder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington + Copyright (C) 2013-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -31,6 +31,15 @@ class Socket; +/** @class EncodeServerFinder + * @brief Locater of encoding servers. + * + * This class finds active (i.e. responding) encode servers. Depending on + * configuration it finds servers by: + * + * 1. broadcasting a request to the local subnet and + * 2. checking to see if any of the configured server hosts are up. + */ class EncodeServerFinder : public Signaller, public ExceptionStore { public: @@ -53,7 +62,7 @@ private: void search_thread (); void listen_thread (); - bool server_found (std::string) const; + boost::optional::iterator> server_found (std::string); void start_accept (); void handle_accept (boost::system::error_code ec, boost::shared_ptr socket); @@ -64,7 +73,9 @@ private: /** Thread to listen to the responses from servers */ boost::thread* _listen_thread; + /** Available servers */ std::list _servers; + /** Mutex for _servers */ mutable boost::mutex _servers_mutex; boost::asio::io_service _listen_io_service;