send a keep alive to keep an idle session alive so it doesn't get removed

pull/1647/head
Jeff Becker 3 years ago
parent 7c6bb9a24c
commit 970ccfcd4e
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -369,6 +369,12 @@ namespace llarp
});
}
if (lastGoodSend > 0s and now >= lastGoodSend + (sendTimeout / 2))
{
// send a keep alive to keep this session alive
KeepAlive();
}
// if we are dead return true so we are removed
return lastGoodSend > 0s ? (now >= lastGoodSend && now - lastGoodSend > sendTimeout)
: (now >= createdAt && now - createdAt > connectTimeout);

Loading…
Cancel
Save