Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 34d41975 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Merge branch '1.x'

parents be1d43b4 69985f6d
......@@ -30,6 +30,7 @@
#include <QHostInfo>
#include <QTcpServer>
#include <QNetworkProxy>
#include <QUdpSocket>
#include <QNetworkSession>
#include <QNetworkConfigurationManager>
......@@ -55,8 +56,11 @@ LanLinkProvider::LanLinkProvider(bool testMode)
connect(&mUdpSocket, &QIODevice::readyRead, this, &LanLinkProvider::newUdpConnection);
mServer = new Server(this);
connect(mServer,&QTcpServer::newConnection,this, &LanLinkProvider::newConnection);
//Detect when a network interface changes status, so we announce ourelves in the new network
QNetworkConfigurationManager* networkManager = new QNetworkConfigurationManager(this);
connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged);
......@@ -135,6 +139,7 @@ void LanLinkProvider::broadcastToNetwork()
#ifdef Q_OS_WIN
//On Windows we need to broadcast from every local IP address to reach all networks
QUdpSocket sendSocket;
for (const QNetworkInterface &iface : QNetworkInterface::allInterfaces()) {
if ( (iface.flags() & QNetworkInterface::IsUp)
&& (iface.flags() & QNetworkInterface::IsRunning)
......@@ -194,6 +199,7 @@ void LanLinkProvider::newUdpConnection() //udpBroadcastReceived
//qCDebug(KDECONNECT_CORE) << "Received Udp identity package from" << sender << " asking for a tcp connection on port " << tcpPort;
QSslSocket* socket = new QSslSocket(this);
receivedIdentityPackages[socket].np = receivedPackage;
receivedIdentityPackages[socket].sender = sender;
connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected);
......@@ -464,6 +470,8 @@ void LanLinkProvider::configureSslSocket(QSslSocket* socket, const QString& devi
void LanLinkProvider::configureSocket(QSslSocket* socket) {
socket->setSocketOption(QAbstractSocket::KeepAliveOption, QVariant(1));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment