mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:13:28 +02:00
Limit number of domain-checkin duplicates
This commit is contained in:
parent
67c0262a4d
commit
12db6a4d10
1 changed files with 2 additions and 0 deletions
|
@ -428,8 +428,10 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendDSCheckIn);
|
||||
|
||||
// Send duplicate check-ins in the exponentially increasing sequence 1, 1, 2, 4, ...
|
||||
static const int MAX_CHECKINS_TOGETHER = 20;
|
||||
int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply();
|
||||
int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1;
|
||||
checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER);
|
||||
for (int i = 1; i < checkinCount; ++i) {
|
||||
auto packetCopy = domainPacket->createCopy(*domainPacket);
|
||||
sendPacket(std::move(packetCopy), _domainHandler.getSockAddr());
|
||||
|
|
Loading…
Reference in a new issue