From 3018b3bf3dabbeffda8bda79569fe8df2a9f8cf0 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Sun, 25 Jun 2023 21:58:50 +0200 Subject: [PATCH] Connect to QUdpSocket's errorOcurred to make errors visible --- core/backends/lan/lanlinkprovider.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index 724c54642..eaa40f291 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -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 QNetworkConfigurationManager *networkManager = new QNetworkConfigurationManager(this); 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)