Contents

localPort(_:)

Specify a specific port to use as the local endpoint, letting the system select the address.

Declaration

func localPort(_ port: NWEndpoint.Port) -> Self

Parameters

  • port:

    The local port to require. Force a specific local port to be used.

Discussion

For connections, this will be used to initiate traffic; for listeners, this will be used for receiving incoming connections.