Instance Property
port
The port number in host byte order.
var port: UInt16 { get }
Discussion
Inspects the underlying storage’s ss_family and reads sin_port or sin6_port accordingly, converting from network byte order (big-endian) back to host byte order. Returns 0 if the address family is neither AF_INET nor AF_INET6 — a defensive fallback that should not occur for addresses produced by this API.