Utils: portOpen: additional error logging

This commit is contained in:
tobtoht 2023-04-20 22:29:37 +02:00
parent f27991b69c
commit 7e89310386
No known key found for this signature in database
GPG key ID: E45B10DD027D2472

View file

@ -299,8 +299,11 @@ bool portOpen(const QString &hostname, quint16 port) { // TODO: this call should
QTcpSocket socket; QTcpSocket socket;
socket.connectToHost(hostname, port, QIODeviceBase::ReadOnly); socket.connectToHost(hostname, port, QIODeviceBase::ReadOnly);
bool res = socket.waitForConnected(600); bool res = socket.waitForConnected(1000);
qDebug() << QString("Port " + (res ? QString("Open") : QString("Closed"))); qDebug() << QString("Port " + (res ? QString("Open") : QString("Closed")));
if (!res) {
qDebug() << "Error: " << socket.error() << " - " << socket.errorString();
}
return res; return res;
} }