summaryrefslogtreecommitdiff
path: root/server/include/server_session.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/include/server_session.h')
-rw-r--r--server/include/server_session.h57
1 files changed, 30 insertions, 27 deletions
diff --git a/server/include/server_session.h b/server/include/server_session.h
index 07e8fcd..436c4ee 100644
--- a/server/include/server_session.h
+++ b/server/include/server_session.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_SESSION_H
#define SERVER_SESSION_H
@@ -34,33 +33,37 @@ class socket_wraper;
class server_session
{
- public:
- server_session(boost::asio::io_service &s, runtime_config_s &config, std::map<std::string, client*> &clients_, std::map<int, download_internal_s> &downloads, boost::asio::ssl::context *c = nullptr);
- void run();
- void send_message(server_msg *msg);
- socket_wraper* socket();
- virtual ~server_session();
- protected:
- private:
- //net
- void handle_read(const boost::system::error_code& error, size_t bytes_transferred);
- void handle_write(const boost::system::error_code& error);
- void handle_write_no_read(const boost::system::error_code& error);
- void handle_handshake(const boost::system::error_code& error);
- bool handle_command(client_msg *msg);
+public:
+ server_session(boost::asio::io_service& s,
+ runtime_config_s& config,
+ std::map<std::string, client*>& clients_,
+ std::map<int, download_internal_s>& downloads,
+ boost::asio::ssl::context* c = nullptr);
+ void run();
+ void send_message(server_msg* msg);
+ socket_wraper* socket();
+ virtual ~server_session();
+protected:
+private:
+ server_session(const server_session&) = delete;
+ // net
+ void handle_read(const boost::system::error_code& error, size_t bytes_transferred);
+ void handle_write(const boost::system::error_code& error);
+ void handle_write_no_read(const boost::system::error_code& error);
+ void handle_handshake(const boost::system::error_code& error);
+ bool handle_command(client_msg* msg);
- char *recv_data_;
- socket_wraper *socket_;
- boost::asio::io_service &io_service_;
- boost::asio::ssl::context *context_;
- std::string client_auth_token;
- runtime_config_s &runtime_config;
- std::map<std::string, client*> &clients;
- client *client_;
- std::map<int, download_internal_s> &downloads;
- //TODO: store client ptr
+ char* recv_data_ = nullptr;
+ socket_wraper* socket_ = nullptr;
+ boost::asio::io_service& io_service_;
+ boost::asio::ssl::context* context_;
+ std::string client_auth_token;
+ runtime_config_s& runtime_config;
+ std::map<std::string, client*>& clients;
+ client* client_ = nullptr;
+ std::map<int, download_internal_s>& downloads;
+ // TODO: store client ptr
};
-
#endif // SERVER_SESSION_H