diff --git a/main.cpp b/main.cpp index ac8a85d..472bbc1 100755 --- a/main.cpp +++ b/main.cpp @@ -242,7 +242,7 @@ int client_on_timer(conn_info_t &conn_info) //for client. called when a timer is mylog(log_debug,"heartbeat sent <%x,%x>\n",conn_info.oppsite_id,conn_info.my_id); - send_safer(conn_info,'h',"",0);/////////////send + send_safer(conn_info,'h',hb_buf,hb_len);/////////////send conn_info.last_hb_sent_time=get_current_time(); return 0; @@ -285,7 +285,7 @@ int server_on_timer_multi(conn_info_t &conn_info,char * ip_port) //for server. return 0; } - send_safer(conn_info,'h',"",0); /////////////send + send_safer(conn_info,'h',hb_buf,hb_len); /////////////send conn_info.last_hb_sent_time=get_current_time(); @@ -920,7 +920,7 @@ int server_on_raw_recv_pre_ready(conn_info_t &conn_info,char * ip_port,u32_t tmp conn_info.last_hb_recv_time = get_current_time(); conn_info.last_hb_sent_time = conn_info.last_hb_recv_time;//=get_current_time() - send_safer(conn_info, 'h',"", 0); /////////////send + send_safer(conn_info, 'h',hb_buf, hb_len); /////////////send mylog(log_info, "[%s]changed state to server_ready\n",ip_port); conn_info.blob->anti_replay.re_init(); @@ -980,7 +980,7 @@ int server_on_raw_recv_pre_ready(conn_info_t &conn_info,char * ip_port,u32_t tmp //ori_conn_info.state.server_current_state=server_ready; ori_conn_info.recover(conn_info); - send_safer(ori_conn_info, 'h',"", 0); + send_safer(ori_conn_info, 'h',hb_buf, hb_len); //ori_conn_info.blob->anti_replay.re_init(); diff --git a/misc.h b/misc.h index 2049d3e..7a287b0 100644 --- a/misc.h +++ b/misc.h @@ -25,13 +25,13 @@ const u32_t client_retry_interval=1000;//ms const u32_t server_handshake_timeout=client_handshake_timeout+5000;// this should be longer than clients. client retry initially ,server retry passtively -const int conv_clear_ratio=10; //conv grabage collecter check 1/10 of all conv one time -const int conn_clear_ratio=30; +const int conv_clear_ratio=30; //conv grabage collecter check 1/30 of all conv one time +const int conn_clear_ratio=50; const int conv_clear_min=1; const int conn_clear_min=1; -const u32_t conv_clear_interval=3000;//ms -const u32_t conn_clear_interval=3000;//ms +const u32_t conv_clear_interval=1000;//ms +const u32_t conn_clear_interval=1000;//ms const i32_t max_fail_time=0;//disable