mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +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
|
||||
_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) {
|
||||
|
@ -406,3 +411,13 @@ std::vector<HifiSockAddr> Socket::getConnectionSockAddrs() {
|
|||
}
|
||||
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:
|
||||
void readPendingDatagrams();
|
||||
void rateControlSync();
|
||||
|
||||
|
||||
void handleSocketError(QAbstractSocket::SocketError socketError);
|
||||
void handleStateChanged(QAbstractSocket::SocketState socketState);
|
||||
|
||||
private:
|
||||
void setSystemBufferSizes();
|
||||
Connection& findOrCreateConnection(const HifiSockAddr& sockAddr);
|
||||
|
|
Loading…
Reference in a new issue