mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Fix SSDP Discovery reliability (#756)
This commit is contained in:
parent
253cd18e89
commit
7773d07571
@ -42,11 +42,14 @@ const QString SSDPDiscover::getFirstService(const searchType& type, const QStrin
|
||||
// search
|
||||
sendSearch(st);
|
||||
|
||||
_udpSocket->waitForReadyRead(timeout_ms);
|
||||
|
||||
while (_udpSocket->hasPendingDatagrams())
|
||||
if ( _udpSocket->waitForReadyRead(timeout_ms) )
|
||||
{
|
||||
while (_udpSocket->waitForReadyRead(500))
|
||||
{
|
||||
QByteArray datagram;
|
||||
while (_udpSocket->hasPendingDatagrams())
|
||||
{
|
||||
|
||||
datagram.resize(_udpSocket->pendingDatagramSize());
|
||||
QHostAddress sender;
|
||||
quint16 senderPort;
|
||||
@ -123,6 +126,8 @@ const QString SSDPDiscover::getFirstService(const searchType& type, const QStrin
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Debug(_log,"Search timeout, service [%s] not found", QSTRING_CSTR(st) );
|
||||
return QString();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user