Merge branch 'master' of github.com:highfidelity/hifi into yellow

This commit is contained in:
Sam Gateau 2019-06-14 11:29:48 -07:00
commit c30e65350a
2 changed files with 14 additions and 9 deletions

View file

@ -306,7 +306,8 @@ void NodeList::sendDomainServerCheckIn() {
// may be called by multiple threads. // may be called by multiple threads.
if (!_sendDomainServerCheckInEnabled) { if (!_sendDomainServerCheckInEnabled) {
qCDebug(networking_ice) << "Refusing to send a domain-server check in while it is disabled."; static const QString DISABLED_CHECKIN_DEBUG{ "Refusing to send a domain-server check in while it is disabled." };
HIFI_FCDEBUG(networking_ice(), DISABLED_CHECKIN_DEBUG);
return; return;
} }
@ -450,13 +451,17 @@ void NodeList::sendDomainServerCheckIn() {
// Send duplicate check-ins in the exponentially increasing sequence 1, 1, 2, 4, ... // Send duplicate check-ins in the exponentially increasing sequence 1, 1, 2, 4, ...
static const int MAX_CHECKINS_TOGETHER = 20; static const int MAX_CHECKINS_TOGETHER = 20;
static const int REBIND_CHECKIN_COUNT = 2;
int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply(); int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply();
/*
static const int WARNING_CHECKIN_COUNT = 2;
if (outstandingCheckins > WARNING_CHECKIN_COUNT) {
// We may be headed for a disconnect, as we've written two DomainListRequests without getting anything back.
// In some cases, we've found that nothing is going out on the wire despite not getting any errors from
// sendPacket => writeDatagram, below. In at least some such cases, we've found that the DomainDisconnectRequest
// does go through, so let's at least try to mix it up with a different safe packet.
// TODO: send ICEPing, and later on tell the other nodes to shut up for a moment.
if (outstandingCheckins > REBIND_CHECKIN_COUNT) { }*/
_nodeSocket.rebind();
}
int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1; int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1;
checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER); checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER);
for (int i = 1; i < checkinCount; ++i) { for (int i = 1; i < checkinCount; ++i) {

View file

@ -230,7 +230,7 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc
// _udpSocket.writeDatagram will return an error anyway, but there are // _udpSocket.writeDatagram will return an error anyway, but there are
// potential crashes in Qt when that happens. // potential crashes in Qt when that happens.
if (_udpSocket.state() != QAbstractSocket::BoundState) { if (_udpSocket.state() != QAbstractSocket::BoundState) {
qCDebug(networking) << "Attempt to writeDatagram when in unbound state"; qCDebug(networking) << "Attempt to writeDatagram when in unbound state to" << sockAddr;
return -1; return -1;
} }
qint64 bytesWritten = _udpSocket.writeDatagram(datagram, sockAddr.getAddress(), sockAddr.getPort()); qint64 bytesWritten = _udpSocket.writeDatagram(datagram, sockAddr.getAddress(), sockAddr.getPort());
@ -240,11 +240,11 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc
#ifdef WIN32 #ifdef WIN32
wsaError = WSAGetLastError(); wsaError = WSAGetLastError();
#endif #endif
qCDebug(networking) << "udt::writeDatagram (" << _udpSocket.state() << ") error - " << wsaError << _udpSocket.error() << "(" << _udpSocket.errorString() << ")" qCDebug(networking) << "udt::writeDatagram (" << _udpSocket.state() << sockAddr << ") error - " << wsaError << _udpSocket.error() << "(" << _udpSocket.errorString() << ")"
<< (pending ? "pending bytes:" : "pending:") << pending; << (pending ? "pending bytes:" : "pending:") << pending;
#ifdef DEBUG_EVENT_QUEUE #ifdef DEBUG_EVENT_QUEUE
int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread());
qCDebug(networking) << "Networking queue size - " << nodeListQueueSize; qCDebug(networking) << "Networking queue size - " << nodeListQueueSize << "writing datagram to" << sockAddr;
#endif // DEBUG_EVENT_QUEUE #endif // DEBUG_EVENT_QUEUE
} }