mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-02-01 04:39:35 +08:00
improve heartbeat
This commit is contained in:
parent
24310edd35
commit
9e010c7f97
@ -711,7 +711,17 @@ int parse_safer(conn_info_t &conn_info,const char * input,int input_len,char &ty
|
||||
conn_info.oppsite_roller=roller;
|
||||
conn_info.last_oppsite_roller_time=get_current_time();
|
||||
}
|
||||
if(hb_mode==0)
|
||||
conn_info.my_roller++;//increase on a successful recv
|
||||
else if(hb_mode==1)
|
||||
{
|
||||
if(type=='h')
|
||||
conn_info.my_roller++;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(0==1);
|
||||
}
|
||||
|
||||
|
||||
if(after_recv_raw0(conn_info.raw_info)!=0) return -1;
|
||||
|
2
main.cpp
2
main.cpp
@ -439,7 +439,7 @@ int client_on_raw_recv(conn_info_t &conn_info) //called when raw fd received a p
|
||||
}
|
||||
if(data_len>=0&&type=='h')
|
||||
{
|
||||
mylog(log_debug,"[hb]heart beat received\n");
|
||||
mylog(log_debug,"[hb]heart beat received,oppsite_roller=%d\n",int(conn_info.oppsite_roller));
|
||||
conn_info.last_hb_recv_time=get_current_time();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user