std::shared_ptr
[dcpomatic.git] / src / lib / server.h
index 7952275232705e8b9d4c943fc855eeadf1aba4a2..fbcd7e870ff006204739ba26258c26d019dadeb5 100644 (file)
@@ -24,6 +24,7 @@
 #include <boost/thread.hpp>
 #include <boost/asio.hpp>
 #include <boost/thread/condition.hpp>
+#include <boost/noncopyable.hpp>
 #include <string>
 
 class Socket;
@@ -31,7 +32,7 @@ class Socket;
 class Server : public boost::noncopyable
 {
 public:
-       explicit Server (int port);
+       explicit Server (int port, int timeout = 30);
        virtual ~Server ();
 
        virtual void run ();
@@ -42,13 +43,14 @@ protected:
        bool _terminate;
 
 private:
-       virtual void handle (boost::shared_ptr<Socket> socket) = 0;
+       virtual void handle (std::shared_ptr<Socket> socket) = 0;
 
        void start_accept ();
-       void handle_accept (boost::shared_ptr<Socket>, boost::system::error_code const &);
+       void handle_accept (std::shared_ptr<Socket>, boost::system::error_code const &);
 
        boost::asio::io_service _io_service;
        boost::asio::ip::tcp::acceptor _acceptor;
+       int _timeout;
 };
 
 #endif