2014-11-19 00:25:21 +08:00
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "master_service.h"
|
|
|
|
|
|
2015-09-16 21:03:02 +08:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2014-11-19 00:25:21 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
char *var_cfg_str;
|
|
|
|
|
acl::master_str_tbl var_conf_str_tab[] = {
|
|
|
|
|
{ "str", "test_msg", &var_cfg_str },
|
|
|
|
|
|
|
|
|
|
{ 0, 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int var_cfg_bool;
|
|
|
|
|
acl::master_bool_tbl var_conf_bool_tab[] = {
|
|
|
|
|
{ "bool", 1, &var_cfg_bool },
|
|
|
|
|
|
|
|
|
|
{ 0, 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int var_cfg_int;
|
|
|
|
|
acl::master_int_tbl var_conf_int_tab[] = {
|
|
|
|
|
{ "int", 120, &var_cfg_int, 0, 0 },
|
|
|
|
|
|
|
|
|
|
{ 0, 0 , 0 , 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
long long int var_cfg_int64;
|
|
|
|
|
acl::master_int64_tbl var_conf_int64_tab[] = {
|
|
|
|
|
{ "int64", 120, &var_cfg_int64, 0, 0 },
|
|
|
|
|
|
|
|
|
|
{ 0, 0 , 0 , 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
|
2015-09-16 21:03:02 +08:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2017-07-05 14:31:18 +08:00
|
|
|
|
master_service::master_service(void)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-05 14:31:18 +08:00
|
|
|
|
master_service::~master_service(void)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void master_service::on_read(acl::socket_stream* stream)
|
|
|
|
|
{
|
|
|
|
|
int n;
|
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
|
|
if ((n = stream->read(buf, sizeof(buf), false)) == -1)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
logger("read from %s, %d bytes", stream->get_peer(), n);
|
|
|
|
|
stream->write(buf, n);
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-05 14:31:18 +08:00
|
|
|
|
void master_service::thread_on_init(void)
|
|
|
|
|
{
|
|
|
|
|
logger(">>thread_on_init<<<");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void master_service::proc_on_bind(acl::socket_stream&)
|
|
|
|
|
{
|
|
|
|
|
logger(">>>proc_on_bind<<<");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void master_service::proc_on_init(void)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
2017-07-05 10:27:33 +08:00
|
|
|
|
logger(">>>proc_on_init<<<");
|
2014-11-19 00:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-05 14:31:18 +08:00
|
|
|
|
void master_service::proc_on_exit(void)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
2017-07-05 10:27:33 +08:00
|
|
|
|
logger(">>>proc_on_exit<<<");
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-05 14:31:18 +08:00
|
|
|
|
void master_service::proc_on_sighup(void)
|
2017-07-05 10:27:33 +08:00
|
|
|
|
{
|
|
|
|
|
logger(">>>proc_on_sighup<<<");
|
2014-11-19 00:25:21 +08:00
|
|
|
|
}
|