Create a host endpoint with a hostname and port.


convenience init(hostname: String, port: String)



A string representation of the hostname or address, such as or


A string containing the port on the host, such as 80.


If the hostname is a domain name, such as, starting a connection to the host endpoint causes the hostname to be resolved to an address during the connection process. If the hostname is an IPv4 or IPv6 address, such as or fe80::1, starting a connection to the host endpoint will cause the address to be used directly.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software