-
Notifications
You must be signed in to change notification settings - Fork 0
/
smsdaemon.h
53 lines (37 loc) · 1.11 KB
/
smsdaemon.h
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
49
50
51
52
53
#ifndef SMS_H_APP_4C9557A02420417f850745DF202C81A5
#define SMS_H_APP_4C9557A02420417f850745DF202C81A5
#include "app.h"
#include <setjmp.h>
namespace SMS{
class CSMSDaemon: public RCL::CApplication{
/*
* 1、构造函数加载 CSMSPProtocol的子类
* 2、构造时加载 CSMSStorage 的子类
* 3、构造时加在 CSMSPrivilige 的子类
* 4、进行 Daemon 初始化
* 5、使用 CSMSPProtocol 进行 Listen
* 6、accept 后使用 CSMSPrivilige 进行认证
* 7、 fork 子进程,如果后续有通过验证的连接,则杀死子进程
* 8、使用 CStorage 进行 dnotify incoming 目录
* 9、阻塞在 read socket 上
* 10、如果有 incoming 文件到达,则 CSMSStorage 调用 CSMSDaemon 的发送函数
*/
protected:
CSMSProtocol *m_pSMSProtocol;
CSMSStorage *m_pSMSStorage;
jmp_buf m_jmpBuf;
public:
CSMSDaemon(char* applicationName,int logFacility)
{
openlog(applicationName,LOG_PID,logFacility);
}
int IsDaemon() {
return 1;
}
int Run();
int OnSignalChild();
int OnSignalTerm();
virtual ~CSMSDaemon();
};
}
#endif