Consume all pendingDatagrams from udpServer

This fixes a bug where receiving broadcast messages would stop working
in case 2 messages have been received at the same time.

The problem is that readReady will only emit once per batch of datagrams
received, in case we receive 2 datagrams but only consume 1, readReady
will never be emitted again.
This commit is contained in:
Àlex Fiestas 2015-05-05 01:04:50 +02:00
parent 3efaae6f88
commit ba4c87abc1

View file

@ -107,13 +107,13 @@ void LanLinkProvider::newUdpConnection()
if (!success || receivedPackage->type() != PACKAGE_TYPE_IDENTITY) {
delete receivedPackage;
return;
continue;
}
if (receivedPackage->get<QString>("deviceId") == KdeConnectConfig::instance()->deviceId()) {
//qCDebug(KDECONNECT_CORE) << "Ignoring my own broadcast";
delete receivedPackage;
return;
continue;
}
int tcpPort = receivedPackage->get<int>("tcpPort", port);