Move rebind on network error to rebind on silent domain checkin

This commit is contained in:
Roxanne Skelly 2019-06-07 13:38:50 -07:00
parent d0bd4a7d47
commit 6643633400
2 changed files with 6 additions and 4 deletions

View file

@ -438,7 +438,13 @@ void NodeList::sendDomainServerCheckIn() {
// Send duplicate check-ins in the exponentially increasing sequence 1, 1, 2, 4, ...
static const int MAX_CHECKINS_TOGETHER = 20;
static const int REBIND_CHECKIN_COUNT = 2;
int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply();
if (outstandingCheckins > REBIND_CHECKIN_COUNT) {
_nodeSocket.rebind();
}
int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1;
checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER);
for (int i = 1; i < checkinCount; ++i) {

View file

@ -508,10 +508,6 @@ void Socket::handleSocketError(QAbstractSocket::SocketError socketError) {
int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread());
qCDebug(networking) << "Networking queue size - " << nodeListQueueSize;
#endif // DEBUG_EVENT_QUEUE
if (_udpSocket.state() == QAbstractSocket::BoundState) {
rebind();
}
}
void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) {