diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 86b33bbe20..be63956191 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -306,7 +306,8 @@ void NodeList::sendDomainServerCheckIn() { // may be called by multiple threads. 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; } @@ -450,13 +451,17 @@ 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(); + /* + 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; checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER); for (int i = 1; i < checkinCount; ++i) { diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index fc6d2cbe2a..3a7a056c77 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -230,7 +230,7 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc // _udpSocket.writeDatagram will return an error anyway, but there are // potential crashes in Qt when that happens. 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; } qint64 bytesWritten = _udpSocket.writeDatagram(datagram, sockAddr.getAddress(), sockAddr.getPort()); @@ -240,11 +240,11 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc #ifdef WIN32 wsaError = WSAGetLastError(); #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; #ifdef DEBUG_EVENT_QUEUE 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 }