mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-04 08:21:03 +00:00
Added divisor for ZT_PEER_ACTIVITY_TIMEOUT, gives quicker indication to status change in SDK
This commit is contained in:
parent
298e1d5a74
commit
95ef13f7a1
@ -340,7 +340,7 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64
|
|||||||
|
|
||||||
// Update online status, post status change as event
|
// Update online status, post status change as event
|
||||||
const bool oldOnline = _online;
|
const bool oldOnline = _online;
|
||||||
_online = (((now - lastReceivedFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT)||(RR->topology->amUpstream()));
|
_online = (((now - lastReceivedFromUpstream) < (ZT_PEER_ACTIVITY_TIMEOUT / (ZT_SDK ? 16 : 1)))||(RR->topology->amUpstream()));
|
||||||
if (oldOnline != _online)
|
if (oldOnline != _online)
|
||||||
postEvent(tptr,_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
|
postEvent(tptr,_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user