The address parameter of NetAddress can only be an IP address for socket-related APIs. What should I do if only the host is available?
Use
getAddressByName
to resolve the host name to obtain the IP address.
Reference
getAddressByName