2019-07-27 22:44:32 +08:00
|
|
|
|
#ifndef __SERVICE_MAIN_INCLUDE_H__
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#define __SERVICE_MAIN_INCLUDE_H__
|
|
|
|
|
|
|
|
|
|
#include "lib_acl.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-07-27 22:44:32 +08:00
|
|
|
|
/* 全局变量 */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
extern ACL_MEM_SLICE *var_mem_slice;
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-27 22:44:32 +08:00
|
|
|
|
* 初始化函数,服务器模板框架启动后仅调用该函数一次
|
|
|
|
|
* @param aio {ACL_AIO*} 异步框架句柄
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
extern void service_init(ACL_AIO *aio, ACL_FIFO *modules);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-27 22:44:32 +08:00
|
|
|
|
* 进程退出时的回调函数
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
extern void service_exit(void);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-27 22:44:32 +08:00
|
|
|
|
* 协议处理函数入口
|
|
|
|
|
* @param fd {ACL_SOCKET} 客户端数据连接
|
|
|
|
|
* @param aio {ACL_AIO*} 异步框架句柄
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
extern int service_main(ACL_SOCKET fd, ACL_AIO *aio);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|