Wake host on a separate worker thread to avoid hanging the UI for DNS resolution

This commit is contained in:
Cameron Gutman
2018-09-05 16:10:32 -07:00
parent 8a2491d955
commit 78730f7235
3 changed files with 26 additions and 3 deletions

View File

@@ -177,6 +177,11 @@ bool NvComputer::wake()
for (QString& addressString : addressList) {
QHostInfo hostInfo = QHostInfo::fromName(addressString);
if (hostInfo.error() != QHostInfo::NoError) {
qWarning() << "Error resolving" << addressString << ":" << hostInfo.errorString();
continue;
}
// Try all IP addresses that this string resolves to
for (QHostAddress& address : hostInfo.addresses()) {
QUdpSocket sock;