mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #15677 from roxanneskelly/bugz516
Log socket error string when socket error happens
This commit is contained in:
commit
b8d6c57483
2 changed files with 28 additions and 4 deletions
|
@ -437,7 +437,18 @@ qint64 LimitedNodeList::sendPacket(std::unique_ptr<NLPacket> packet, const HifiS
|
|||
|
||||
return size;
|
||||
} else {
|
||||
return sendUnreliablePacket(*packet, sockAddr, hmacAuth);
|
||||
auto size = sendUnreliablePacket(*packet, sockAddr, hmacAuth);
|
||||
if (size < 0) {
|
||||
auto now = usecTimestampNow();
|
||||
eachNode([now](const SharedNodePointer & node) {
|
||||
qCDebug(networking) << "Stats for " << node->getPublicSocket() << "\n"
|
||||
<< " Last Heard Microstamp: " << node->getLastHeardMicrostamp() << " (" << (now - node->getLastHeardMicrostamp()) << "usec ago)\n"
|
||||
<< " Outbound Kbps: " << node->getOutboundKbps() << "\n"
|
||||
<< " Inbound Kbps: " << node->getInboundKbps() << "\n"
|
||||
<< " Ping: " << node->getPingMs();
|
||||
});
|
||||
}
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -226,8 +226,17 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc
|
|||
qint64 bytesWritten = _udpSocket.writeDatagram(datagram, sockAddr.getAddress(), sockAddr.getPort());
|
||||
|
||||
if (bytesWritten < 0) {
|
||||
// when saturating a link this isn't an uncommon message - suppress it so it doesn't bomb the debug
|
||||
qCDebug(networking) << "Socket::writeDatagram : " << sockAddr << " " << _udpSocket.error();
|
||||
qCDebug(networking) << "udt::writeDatagram (" << _udpSocket.state() << ") error - " << _udpSocket.error() << "(" << _udpSocket.errorString() << ")";
|
||||
|
||||
#ifdef WIN32
|
||||
int wsaError = WSAGetLastError();
|
||||
qCDebug(networking) << "windows socket error " << wsaError;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_EVENT_QUEUE
|
||||
int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread());
|
||||
qCDebug(networking) << "Networking queue size - " << nodeListQueueSize;
|
||||
#endif // DEBUG_EVENT_QUEUE
|
||||
}
|
||||
|
||||
return bytesWritten;
|
||||
|
@ -490,7 +499,11 @@ std::vector<HifiSockAddr> Socket::getConnectionSockAddrs() {
|
|||
}
|
||||
|
||||
void Socket::handleSocketError(QAbstractSocket::SocketError socketError) {
|
||||
qCDebug(networking) << "udt::Socket error - " << socketError;
|
||||
qCDebug(networking) << "udt::Socket (" << _udpSocket.state() << ") error - " << socketError << "(" << _udpSocket.errorString() << ")";
|
||||
#ifdef DEBUG_EVENT_QUEUE
|
||||
int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread());
|
||||
qCDebug(networking) << "Networking queue size - " << nodeListQueueSize;
|
||||
#endif // DEBUG_EVENT_QUEUE
|
||||
}
|
||||
|
||||
void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) {
|
||||
|
|
Loading…
Reference in a new issue