From 377f478aeb3e2c64519fadc17166b4c7d2db34f4 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sun, 26 May 2019 20:36:35 +0200 Subject: [PATCH] Print socket error when connection fails --- core/backends/lan/lanlinkprovider.cpp | 3 ++- core/backends/lan/lanlinkprovider.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index 6b768f5fd..429ea5a7d 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -215,13 +215,14 @@ void LanLinkProvider::newUdpConnection() //udpBroadcastReceived } } -void LanLinkProvider::connectError() +void LanLinkProvider::connectError(QAbstractSocket::SocketError socketError) { QSslSocket* socket = qobject_cast(sender()); if (!socket) return; disconnect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected); disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); + qCDebug(KDECONNECT_CORE) << "Socket error" << socketError; qCDebug(KDECONNECT_CORE) << "Fallback (1), try reverse connection (send udp packet)" << socket->errorString(); NetworkPacket np(QLatin1String("")); NetworkPacket::createIdentityPacket(&np); diff --git a/core/backends/lan/lanlinkprovider.h b/core/backends/lan/lanlinkprovider.h index 3988e3a77..a163f2007 100644 --- a/core/backends/lan/lanlinkprovider.h +++ b/core/backends/lan/lanlinkprovider.h @@ -64,7 +64,7 @@ public Q_SLOTS: void onStop() override; void connected(); void encrypted(); - void connectError(); + void connectError(QAbstractSocket::SocketError socketError); private Q_SLOTS: void newUdpConnection();