一、mars Tcp链接超时、心跳间隔
链接超时
[ConnectImpatient, 473][MARS]_vecaddr size:4, m_timeout:10000, m_interval:4000, m_error_interval:4000, m_max_connect:3
1 host ip或者端口不可用 socket 也不进行尝试,如果域名直接dns解析失败不进行尝试,
2 IPConnectTimoutMode默认用的是FIXED 固定的,interval_默认4000ms
laststart_connecttime = curtime - std::max(interval_, error_interval_);
curtime = gettickcount();
next_connect_timeout = int(((0 == lasterror) ? interval_ : error_interval_) - (curtime - laststart_connecttime));
next_connect_timeout 为-1,当前时间减去laststart_connecttime
next_connect_timeout小于interval_或error_interval_,timeout使用的是
timeout = std::min(timeout, (int)interval_);
next_connect_timeout>0就是大于interval_或error_interval_,timeout使用的就是next_connect_timeout
timeout = std::min(timeout, next_connect_timeout);
重链 Reconnect
static unsigned long const sg_interval[][