Look up unknown subtitle end times from the data prepared by the examiner.
[dcpomatic.git] / src / lib / server_finder.h
index 6f02042cee6034827e4a6ad0d4b8ca9e0f0cc988..3fab6864a332ef43b3b62a59bf2ccab75d49aae6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 class ServerFinder : public ExceptionStore
 {
 public:
-       void connect (boost::function<void (ServerDescription)>);
+       boost::signals2::connection connect (boost::function<void (ServerDescription)>);
 
        static ServerFinder* instance ();
+       static void drop ();
 
        void disable () {
                _disabled = true;
        }
 
+       bool disabled () const {
+               return _disabled;
+       }
+
 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 +59,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;
 };