mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
add debug for socket errors and state changes
This commit is contained in:
parent
42169ddcb3
commit
7192ad301f
2 changed files with 19 additions and 1 deletions
|
@ -36,6 +36,11 @@ Socket::Socket(QObject* parent) :
|
||||||
|
|
||||||
// start our timer for the synchronization time interval
|
// start our timer for the synchronization time interval
|
||||||
_synTimer->start(_synInterval);
|
_synTimer->start(_synInterval);
|
||||||
|
|
||||||
|
// make sure we hear about errors and state chagnes from the underlying socket
|
||||||
|
connect(&_udpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
|
||||||
|
this, SLOT(handleSocketError(QAbstractSocket::SocketError)));
|
||||||
|
connect(&_udpSocket, &QAbstractSocket::stateChanged, this, &Socket::handleStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Socket::bind(const QHostAddress& address, quint16 port) {
|
void Socket::bind(const QHostAddress& address, quint16 port) {
|
||||||
|
@ -406,3 +411,13 @@ std::vector<HifiSockAddr> Socket::getConnectionSockAddrs() {
|
||||||
}
|
}
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Socket::handleSocketError(QAbstractSocket::SocketError socketError) {
|
||||||
|
qWarning() << "udt::Socket error -" << socketError;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) {
|
||||||
|
if (socketState != QAbstractSocket::BoundState) {
|
||||||
|
qWarning() << "udt::Socket state changed - state is now" << socketState;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -86,7 +86,10 @@ public slots:
|
||||||
private slots:
|
private slots:
|
||||||
void readPendingDatagrams();
|
void readPendingDatagrams();
|
||||||
void rateControlSync();
|
void rateControlSync();
|
||||||
|
|
||||||
|
void handleSocketError(QAbstractSocket::SocketError socketError);
|
||||||
|
void handleStateChanged(QAbstractSocket::SocketState socketState);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setSystemBufferSizes();
|
void setSystemBufferSizes();
|
||||||
Connection& findOrCreateConnection(const HifiSockAddr& sockAddr);
|
Connection& findOrCreateConnection(const HifiSockAddr& sockAddr);
|
||||||
|
|
Loading…
Reference in a new issue