diff options
Diffstat (limited to 'server/include/server.h')
-rw-r--r-- | server/include/server.h | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/server/include/server.h b/server/include/server.h index 812406a..e8fb3ad 100644 --- a/server/include/server.h +++ b/server/include/server.h @@ -1,5 +1,5 @@ /* - Copyright © 2015 Gluzskiy Alexandr (sss) + Copyright © 2015 Gluzskiy Alexandr (sss) This file is part of Unknown Download Manager (UDM). @@ -18,7 +18,6 @@ */ - #ifndef SERVER_H #define SERVER_H @@ -28,32 +27,34 @@ #include "client.h" #include "download_internal.h" -//TODO ssl +// TODO ssl class server_session; - class server { public: - server(boost::asio::io_service& io_service, runtime_config_s &config, std::map<std::string, client*> &clients, std::map<int, download_internal_s> &downloads, short port); - void terminate() - { + server(boost::asio::io_service& io_service, + runtime_config_s& config, + std::map<std::string, client*>& clients, + std::map<int, download_internal_s>& downloads, + short port); + void terminate() + { io_service_.stop(); - } + } private: - void start_accept(); - void handle_accept(server_session* new_session, const boost::system::error_code& error); - - boost::asio::io_service& io_service_; - boost::asio::ip::tcp::acceptor acceptor_; - boost::asio::ssl::context *context_; - runtime_config_s &runtime_config; - std::map<std::string, client*> &clients; - std::map<int, download_internal_s> &downloads; + server(const server&) = delete; + void start_accept(); + void handle_accept(server_session* new_session, const boost::system::error_code& error); + + boost::asio::io_service& io_service_; + boost::asio::ip::tcp::acceptor acceptor_; + boost::asio::ssl::context* context_; + runtime_config_s& runtime_config; + std::map<std::string, client*>& clients; + std::map<int, download_internal_s>& downloads; }; - - #endif // SERVER_H |