Connect to QUdpSocket's errorOcurred to make errors visible

This commit is contained in:
Albert Vaca Cintora 2023-06-25 21:58:50 +02:00
parent 598dde025c
commit 3018b3bf3d

View file

@ -62,6 +62,10 @@ LanLinkProvider::LanLinkProvider(bool testMode, quint16 udpBroadcastPort, quint1
// Detect when a network interface changes status, so we announce ourselves in the new network // Detect when a network interface changes status, so we announce ourselves in the new network
QNetworkConfigurationManager *networkManager = new QNetworkConfigurationManager(this); QNetworkConfigurationManager *networkManager = new QNetworkConfigurationManager(this);
connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged); connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged);
connect(&m_udpSocket, &QAbstractSocket::errorOccurred, [](QAbstractSocket::SocketError socketError) {
qWarning() << "Error sending UDP packet:" << socketError;
});
} }
void LanLinkProvider::onNetworkConfigurationChanged(const QNetworkConfiguration &config) void LanLinkProvider::onNetworkConfigurationChanged(const QNetworkConfiguration &config)