mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-30 02:47:56 +08:00
modify demos' IO timeout from 0 to -1 because the changing of IO timeout meaning
This commit is contained in:
parent
7b0a314136
commit
7c97be44a9
@ -42,15 +42,15 @@ int var_cfg_rw_timeout;
|
||||
int var_cfg_max_threads;
|
||||
|
||||
acl::master_int_tbl var_conf_int_tab[] = {
|
||||
{ "rw_timeout", 120, &var_cfg_rw_timeout, 0, 0 },
|
||||
{ "ioctl_max_threads", 128, &var_cfg_max_threads, 0, 0 },
|
||||
{ "rw_timeout", 120, &var_cfg_rw_timeout, 0, 0 },
|
||||
{ "ioctl_max_threads", 128, &var_cfg_max_threads, 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 },
|
||||
{ "int64", 120, &var_cfg_int64, 0, 0 },
|
||||
|
||||
{ 0, 0 , 0 , 0, 0 }
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
static char *var_cfg_str;
|
||||
|
||||
acl::master_str_tbl var_conf_str_tab[] = {
|
||||
{ "str", "test_msg", &var_cfg_str },
|
||||
{ "str", "test_msg", &var_cfg_str },
|
||||
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
@ -12,7 +12,7 @@ acl::master_str_tbl var_conf_str_tab[] = {
|
||||
static int var_cfg_debug_enable;
|
||||
|
||||
acl::master_bool_tbl var_conf_bool_tab[] = {
|
||||
{ "debug_enable", 1, &var_cfg_debug_enable },
|
||||
{ "debug_enable", 1, &var_cfg_debug_enable },
|
||||
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
@ -20,7 +20,7 @@ acl::master_bool_tbl var_conf_bool_tab[] = {
|
||||
static int var_cfg_io_timeout;
|
||||
|
||||
acl::master_int_tbl var_conf_int_tab[] = {
|
||||
{ "io_timeout", 120, &var_cfg_io_timeout, 0, 0 },
|
||||
{ "io_timeout", 120, &var_cfg_io_timeout, 0, 0 },
|
||||
|
||||
{ 0, 0 , 0 , 0, 0 }
|
||||
};
|
||||
@ -43,7 +43,7 @@ master_service::~master_service(void)
|
||||
void master_service::on_accept(acl::socket_stream& conn)
|
||||
{
|
||||
logger(">>>accept connection: %d", conn.sock_handle());
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(var_cfg_io_timeout);
|
||||
|
||||
acl::string buf;
|
||||
|
||||
|
@ -17,7 +17,7 @@ void master_service::on_accept(acl::socket_stream& conn)
|
||||
{
|
||||
logger("connect from %s, fd %d", conn.get_peer(), conn.sock_handle());
|
||||
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(-1);
|
||||
|
||||
acl::memcache_session session("127.0.0.1:11211");
|
||||
http_servlet servlet(&conn, &session);
|
||||
|
@ -71,7 +71,7 @@ bool master_service::thread_on_accept(acl::socket_stream* conn)
|
||||
{
|
||||
logger("connect from %s, fd: %d", conn->get_peer(true),
|
||||
conn->sock_handle());
|
||||
conn->set_rw_timeout(0);
|
||||
conn->set_rw_timeout(-1);
|
||||
|
||||
// 使用 redis 集群来存储 session
|
||||
http_servlet* servlet = new http_servlet(*session_server,
|
||||
|
@ -71,7 +71,7 @@ bool master_service::thread_on_accept(acl::socket_stream* conn)
|
||||
{
|
||||
logger("connect from %s, fd: %d", conn->get_peer(true),
|
||||
conn->sock_handle());
|
||||
conn->set_rw_timeout(0);
|
||||
conn->set_rw_timeout(-1);
|
||||
|
||||
// 使用 redis 集群来存储 session
|
||||
WebsocketServlet_impl* servlet = new WebsocketServlet_impl(*session_server,
|
||||
|
@ -73,7 +73,7 @@ bool master_service::thread_on_accept(acl::socket_stream* conn)
|
||||
{
|
||||
logger("connect from %s, fd: %d", conn->get_peer(true),
|
||||
conn->sock_handle());
|
||||
conn->set_rw_timeout(0);
|
||||
conn->set_rw_timeout(-1);
|
||||
conn->set_tcp_non_blocking(false);
|
||||
|
||||
// 使用 redis 集群来存储 session
|
||||
|
@ -75,7 +75,7 @@ bool master_service::thread_on_accept(acl::socket_stream* conn)
|
||||
{
|
||||
logger("connect from %s, fd: %d", conn->get_peer(true),
|
||||
conn->sock_handle());
|
||||
conn->set_rw_timeout(0);
|
||||
conn->set_rw_timeout(-1);
|
||||
conn->set_tcp_non_blocking(false);
|
||||
|
||||
// 使用 redis 集群来存储 session
|
||||
|
@ -44,7 +44,7 @@ static void client_logout(user_client* client)
|
||||
static void fiber_reader(user_client* client)
|
||||
{
|
||||
acl::socket_stream& conn = client->get_stream();
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(-1);
|
||||
|
||||
if (client_login(client) == false)
|
||||
{
|
||||
|
@ -265,7 +265,7 @@ static int __nreader = 0;
|
||||
static void fiber_reader(user_client* client)
|
||||
{
|
||||
acl::socket_stream& conn = client->get_stream();
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(-1);
|
||||
|
||||
client->set_reader();
|
||||
client->set_reading(true);
|
||||
@ -289,7 +289,7 @@ static void fiber_reader(user_client* client)
|
||||
fiber_writer(client);
|
||||
};
|
||||
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(-1);
|
||||
|
||||
bool stop = false;
|
||||
acl::string buf;
|
||||
|
@ -45,7 +45,7 @@ static void client_logout(user_client* client)
|
||||
static void fiber_writer(user_client* client)
|
||||
{
|
||||
acl::socket_stream& conn = client->get_stream();
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(-1);
|
||||
|
||||
if (client_login(client) == false)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ protected:
|
||||
// @override
|
||||
void on_accept(acl::socket_stream& conn) {
|
||||
acl_msg_info(">>>accept connection: %d", conn.sock_handle());
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(-1);
|
||||
acl::memcache_session session("127.0.0.1:11211");
|
||||
http_servlet servlet(&conn, &session);
|
||||
servlet.setLocalCharset("gb2312");
|
||||
|
@ -40,7 +40,7 @@ protected:
|
||||
void on_accept(acl::socket_stream& conn)
|
||||
{
|
||||
acl_msg_info(">>>accept connection: %d", conn.sock_handle());
|
||||
conn.set_rw_timeout(0);
|
||||
conn.set_rw_timeout(-1);
|
||||
|
||||
tcp_proxy(conn, var_cfg_remote_addr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user