parent
637285378d
commit
4c75626919
1 changed files with 7 additions and 4 deletions
|
@ -88,11 +88,14 @@ void LanLinkProvider::onStart()
|
||||||
|
|
||||||
bool success = m_udpSocket.bind(bindAddress, UDP_PORT, QUdpSocket::ShareAddress);
|
bool success = m_udpSocket.bind(bindAddress, UDP_PORT, QUdpSocket::ShareAddress);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
QAbstractSocket::SocketError sockErr = m_udpSocket->error();
|
QAbstractSocket::SocketError sockErr = m_udpSocket.error();
|
||||||
// Refer to https://doc.qt.io/qt-5/qabstractsocket.html#SocketError-enum to decode socket error number
|
// Refer to https://doc.qt.io/qt-5/qabstractsocket.html#SocketError-enum to decode socket error number
|
||||||
QString errorMessage = QLatin1String("Failed to bind UDP socket with error ");
|
QString errorMessage = QMetaEnum::fromType<QAbstractSocket::SocketError>().valueToKey(sockErr);
|
||||||
errorMessage = errorMessage + QMetaEnum::fromType<QAbstractSocket::SocketError>().valueToKey(sockErr);
|
qCritical(KDECONNECT_CORE)
|
||||||
qCritical(errorMessage.toLocal8Bit().data());
|
<< QLatin1String("Failed to bind UDP socket on port")
|
||||||
|
<< UDP_PORT
|
||||||
|
<< QLatin1String("with error")
|
||||||
|
<< errorMessage;
|
||||||
}
|
}
|
||||||
Q_ASSERT(success);
|
Q_ASSERT(success);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue