Network/ENetHost: Fix hostname resolve

This commit is contained in:
Jérôme Leclercq 2017-07-11 12:12:38 +02:00
parent cbcfa5cb4d
commit 394f0bc730
1 changed files with 8 additions and 3 deletions

View File

@ -128,13 +128,18 @@ namespace Nz
if (!result.address) if (!result.address)
continue; continue;
if (result.socketType != SocketType_UDP)
continue;
hostnameAddress = result.address; hostnameAddress = result.address;
break; //< Take first valid address break; //< Take first valid address
} }
if (!hostnameAddress.IsValid())
{
if (error)
*error = ResolveError_NotFound;
return nullptr;
}
return Connect(hostnameAddress, channelCount, data); return Connect(hostnameAddress, channelCount, data);
} }