Type Alias

nw_parameters_t

An object that stores the protocols to use for connections, options for sending data, and network path constraints.

Declaration

typealias nw_parameters_t = OS_nw_parameters

Topics

Creating Parameters

typealias nw_parameters_configure_protocol_block_t

A block to configure protocol options during the creation of a parameters object.

func nw_parameters_create() -> nw_parameters_t

Initializes parameters for connections, listeners, and browsers with no protocols specified.

func nw_parameters_create_custom_ip(UInt8, nw_parameters_configure_protocol_block_t) -> nw_parameters_t

Initializes parameters for connections and listeners using a custom IP protocol.

func nw_parameters_copy(nw_parameters_t) -> nw_parameters_t

Peforms a deep copy of a parameters object.

Modifying Protocol Stacks

func nw_parameters_copy_default_protocol_stack(nw_parameters_t) -> nw_protocol_stack_t

Accesses the protocol stack used by connections and listeners.

typealias nw_protocol_stack_t

An ordered set of protocol options that define the protocols that connections and listeners use.

typealias nw_protocol_definition_t

The abstract superclass for identifying a network protocol.

typealias nw_protocol_options_t

The abstract superclass for configuring the options of a network protocol.

Selecting Paths

func nw_parameters_set_required_interface_type(nw_parameters_t, nw_interface_type_t)

Sets an interface type to require on connections and listeners.

func nw_parameters_get_required_interface_type(nw_parameters_t) -> nw_interface_type_t

Accesses the interface type required on connections and listeners.

func nw_parameters_require_interface(nw_parameters_t, nw_interface_t?)

Sets a specific interface to require on connections, listeners, and browsers.

func nw_parameters_copy_required_interface(nw_parameters_t) -> nw_interface_t?

Accesses the interface required on connections, listeners, and browsers.

func nw_parameters_set_local_endpoint(nw_parameters_t, nw_endpoint_t?)

Sets a specific local IP address and port to use for connections and listeners.

func nw_parameters_copy_local_endpoint(nw_parameters_t) -> nw_endpoint_t?

Accesses the local IP address and port used for connections and listeners.

func nw_parameters_set_prohibit_constrained(nw_parameters_t, Bool)

Prevents connections, listeners, and browsers from using network paths marked as constrained by Low Data Mode.

func nw_parameters_get_prohibit_constrained(nw_parameters_t) -> Bool

Checks if connections, listeners, and browsers are prevented from using network paths marked as constrained by Low Data Mode.

func nw_parameters_set_prohibit_expensive(nw_parameters_t, Bool)

Prevents connections, listeners, and browsers from using network paths marked as expensive.

func nw_parameters_get_prohibit_expensive(nw_parameters_t) -> Bool

Checks if connections, listeners, and browsers are prevented from using network paths marked as expensive.

func nw_parameters_prohibit_interface_type(nw_parameters_t, nw_interface_type_t)

Prevents connections, listeners, and browsers from using a specific interface type.

typealias nw_parameters_iterate_interface_types_block_t

A block that allows inspection of a list of interface types.

func nw_parameters_prohibit_interface(nw_parameters_t, nw_interface_t)

Prevents connections and listeners from using a specific interface.

typealias nw_parameters_iterate_interfaces_block_t

A block that allows inspection of a list of interfaces.

Customizing Connection Options

func nw_parameters_set_multipath_service(nw_parameters_t, nw_multipath_service_t)

Enables multipath protocols to allow connections to use multiple interfaces.

struct nw_multipath_service_t

Modes in which a connection can support multipath protocols.

func nw_parameters_set_service_class(nw_parameters_t, nw_service_class_t)

Sets a level of service quality to use for connections.

func nw_parameters_get_service_class(nw_parameters_t) -> nw_service_class_t

Checks the level of service quality used for connections.

struct nw_service_class_t

Levels of service quality that can be used with a connection.

func nw_parameters_set_fast_open_enabled(nw_parameters_t, Bool)

Enables sending application data with protocol handshakes.

func nw_parameters_get_fast_open_enabled(nw_parameters_t) -> Bool

Checks if sending application data with protocol handshakes is enabled.

struct nw_parameters_expired_dns_behavior_t

Options for configuring how expired DNS answers should be used.

func nw_parameters_set_prefer_no_proxy(nw_parameters_t, Bool)

Sets a Boolean that indicates that connections should ignore proxies when they are enabled on the system.

func nw_parameters_set_include_peer_to_peer(nw_parameters_t, Bool)

Enables peer-to-peer link technologies for connections and listeners.

func nw_parameters_get_include_peer_to_peer(nw_parameters_t) -> Bool

Checks whether a connection is allowed to use peer-to-peer link technologies.

func nw_parameters_set_reuse_local_address(nw_parameters_t, Bool)

Allows reusing local addresses and ports across connections.

func nw_parameters_get_reuse_local_address(nw_parameters_t) -> Bool

Checks whether a connection allows reusing local addresses and ports.

func nw_parameters_set_local_only(nw_parameters_t, Bool)

Restricts listeners to only accepting connections from the local link.

func nw_parameters_get_local_only(nw_parameters_t) -> Bool

Checks if a listener is restricted to accepting connections from the local link.