Instance Property
localPort
The local TCP port this listener is bound to (host byte order).
var localPort: UInt16 { get }
Mentioned In
Discussion
Convenience over localAddress. Returns 0 if the address is not available (e.g. the socket is closed) or the address family is not AF_INET / AF_INET6.