NetCoreServer icon indicating copy to clipboard operation
NetCoreServer copied to clipboard

is it possible to use a fqdn instead of an ip

Open ekjuanrejon opened this issue 4 years ago • 1 comments

I am using the chat client example. I am using a static ip address like 127.0.0.1. I would to use something like tcp.example.com and port 8888.

I am getting an error when using a host name

any ideas?

Thanks

ekjuanrejon avatar Jun 27 '20 20:06 ekjuanrejon

IPHostEntry ipHostInfo = Dns.GetHostEntry(hostName);
IPAddress ipAddress = ipHostInfo.AddressList.FirstOrDefault(a => a.AddressFamily == AddressFamily.InterNetwork);

chronoxor avatar Jun 27 '20 20:06 chronoxor