-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsession_manager.h
More file actions
48 lines (42 loc) · 1 KB
/
session_manager.h
File metadata and controls
48 lines (42 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _SESSION_MANAGER_H_
#define _SESSION_MANAGER_H_
#include "session_thread_pool.h"
#include "session_pending_pool.h"
#include "user_manager.h"
#include "session_task.h"
namespace ftp_server
{
class session_manager
{
public:
int session_thread_num;
session_thread_pool *p_s_thread_pool;
// session_pending_pool *p_s_pending_pool;
user_manager *p_user_manager;
public:
map<int , session *> m_session_map;
public:
session_manager()
{
session_thread_num = g_config.session_thread_num;
p_s_thread_pool = new session_thread_pool( session_thread_num );
// p_s_pending_pool = new session_pending_pool();
p_user_manager = new user_manager();
};
~session_manager()
{
delete p_s_thread_pool;
p_s_thread_pool = NULL;
delete p_user_manager;
p_user_manager = NULL;
};
public:
bool start_proc();
public:
bool post_to_session( session_task *event_task );
void add_session(session *_session);
session *seek_session( int fd );
bool del_session( int fd );
};
};
#endif