创建远程连接时打开域名解析
This commit is contained in:
parent
b42f7c5ab3
commit
15ea0db358
|
@ -134,8 +134,12 @@ Socket* NetworkInterface::CreateRemote(const NetUri& uri)
|
||||||
auto socket = CreateSocket(uri.Type);
|
auto socket = CreateSocket(uri.Type);
|
||||||
if (socket)
|
if (socket)
|
||||||
{
|
{
|
||||||
|
// 域名解析
|
||||||
|
auto ip = QueryDNS(uri.Host);
|
||||||
|
if (ip == IPAddress::Any())ip = uri.Address;
|
||||||
|
|
||||||
socket->Local.Address = IP;
|
socket->Local.Address = IP;
|
||||||
socket->Remote.Address = uri.Address;
|
socket->Remote.Address = ip;
|
||||||
socket->Remote.Port = uri.Port;
|
socket->Remote.Port = uri.Port;
|
||||||
socket->Server = uri.Host;
|
socket->Server = uri.Host;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue