Network Functions

Access Network framework functions used in C.

Topics

Functions

func nw_advertise_descriptor_get_no_auto_rename(nw_advertise_descriptor_t) -> Bool

Checks whether the service prohibits automatic renaming in the event of a name conflict.

func nw_advertise_descriptor_set_no_auto_rename(nw_advertise_descriptor_t, Bool)

Sets a Boolean to indicate whether the service prohibits automatic renaming in the event of a name conflict.

func nw_advertise_descriptor_set_txt_record(nw_advertise_descriptor_t, UnsafeRawPointer?, Int)

Sets the TXT record as a raw buffer to advertise with the service.

func nw_browse_descriptor_get_include_txt_record(nw_browse_descriptor_t) -> Bool

Checks if the browse descriptor requires including associated TXT records with all results.

func nw_browse_descriptor_set_include_txt_record(nw_browse_descriptor_t, Bool)

Requires including associated TXT records with all results generated for this service descriptor.

func nw_browse_result_copy_txt_record_object(nw_browse_result_t) -> nw_txt_record_t?

Accesses the TXT record associated with a discovered service.

func nw_browse_result_enumerate_interfaces(nw_browse_result_t, (nw_interface_t) -> Bool)

Enumerates the list of interfaces on which the service was discovered.

func nw_browse_result_get_interfaces_count(nw_browse_result_t) -> Int

Accesses the number of interfaces associated with a discovered service.

func nw_browser_cancel(nw_browser_t)

Stops browsing for services.

func nw_browser_copy_browse_descriptor(nw_browser_t) -> nw_browse_descriptor_t

Accesses the service descriptor with which the browser was created.

func nw_browser_copy_parameters(nw_browser_t) -> nw_parameters_t

Accesses the parameters with which the browser was created.

func nw_browser_create(nw_browse_descriptor_t, nw_parameters_t?) -> nw_browser_t

Initializes a browser with a type of service to discover.

func nw_browser_set_queue(nw_browser_t, DispatchQueue)

Sets the queue on which all browser events will be delivered.

func nw_browser_start(nw_browser_t)

Starts browsing for services.

func nw_connection_access_establishment_report(nw_connection_t, DispatchQueue, nw_establishment_report_access_block_t)

Requests a copy of the connection's establishment report once the connection is in the ready state.

func nw_connection_batch(nw_connection_t, () -> Void)

Defines a block in which calls to send and receive are processed as a batch to improve performance.

func nw_connection_cancel(nw_connection_t)

Cancels the connection and gracefully disconnects any established network protocols.

func nw_connection_cancel_current_endpoint(nw_connection_t)

Causes the current endpoint to be rejected, allowing the connection to try another resolved address.

func nw_connection_copy_current_path(nw_connection_t) -> nw_path_t?

Accesses the network path the connection is using.

func nw_connection_copy_endpoint(nw_connection_t) -> nw_endpoint_t

Accesses the endpoint with which the connection was created.

func nw_connection_copy_parameters(nw_connection_t) -> nw_parameters_t

Accesses the parameters with which the connection was created.

func nw_connection_create_new_data_transfer_report(nw_connection_t) -> nw_data_transfer_report_t

Begins a new data transfer report, which can later be collected.

func nw_connection_force_cancel(nw_connection_t)

Cancels the connection and immediately disconnects any established network protocols.

func nw_connection_get_maximum_datagram_size(nw_connection_t) -> UInt32

Accesses the maximum size of a datagram message that can be sent on a connection.

func nw_connection_receive(nw_connection_t, UInt32, UInt32, nw_connection_receive_completion_t)

Schedules a single receive completion handler, with a range indicating how many bytes the handler can receive at one time.

func nw_connection_receive_message(nw_connection_t, nw_connection_receive_completion_t)

Schedules a single receive completion handler for a complete message, as opposed to a range of bytes.

func nw_connection_restart(nw_connection_t)

Restarts a connection that is in the waiting state.

func nw_connection_set_better_path_available_handler(nw_connection_t, nw_connection_boolean_event_handler_t?)

Sets a handler that receives updates when an alternative network path is preferred over the current path.

func nw_connection_set_queue(nw_connection_t, DispatchQueue)

Sets the queue on which all connection events are delivered.

func nw_connection_set_viability_changed_handler(nw_connection_t, nw_connection_boolean_event_handler_t?)

Sets a handler that receives updates when data can be sent and received.

func nw_connection_start(nw_connection_t)

Starts establishing a connection.

func nw_content_context_copy_antecedent(nw_content_context_t) -> nw_content_context_t?

Accesses the optional message context that must be sent before the context you are sending.

func nw_content_context_get_identifier(nw_content_context_t) -> UnsafePointer<Int8>

Accesses the identifier used to create this message context.

func nw_content_context_get_is_final(nw_content_context_t) -> Bool

Checks whether this context represents the final message being received.

func nw_content_context_get_relative_priority(nw_content_context_t) -> Double

Accesses the relative value of priority used to reorder contexts when sending.

func nw_content_context_set_antecedent(nw_content_context_t, nw_content_context_t?)

Set an optional message context that must be sent before the context you are sending.

func nw_content_context_set_expiration_milliseconds(nw_content_context_t, UInt64)

Sets the number of milliseconds after which sending the data associated with this context must begin, otherwise the data is discarded.

func nw_content_context_set_is_final(nw_content_context_t, Bool)

Sets a Boolean indicating if this context represents the final message being sent.

func nw_content_context_set_metadata_for_protocol(nw_content_context_t, nw_protocol_metadata_t)

Sets protocol metadata to configure per-message or per-packet properties.

func nw_content_context_set_relative_priority(nw_content_context_t, Double)

Sets the relative value of priority used to reorder contexts when sending.

func nw_data_transfer_report_get_duration_milliseconds(nw_data_transfer_report_t) -> UInt64

Checks the duration of the data transfer report, from when it was started to when it was collected.

func nw_data_transfer_report_get_transport_minimum_rtt_milliseconds(nw_data_transfer_report_t, UInt32) -> UInt64

Accesses the minimum round-trip time the transport protocol measured, in milliseconds.

func nw_data_transfer_report_get_transport_rtt_variance(nw_data_transfer_report_t, UInt32) -> UInt64

Accesses the variance of the round-trip time the transport protocol measured.

func nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds(nw_data_transfer_report_t, UInt32) -> UInt64

Accesses the smoothed round-trip time the transport protocol measured, in milliseconds.

func nw_endpoint_create_address(UnsafePointer<sockaddr>) -> nw_endpoint_t

Creates a network endpoint with an address structure.

func nw_endpoint_create_host(UnsafePointer<Int8>, UnsafePointer<Int8>) -> nw_endpoint_t

Creates a network endpoint with a hostname and port, where the hostname may be interpreted as an IP address.

func nw_endpoint_create_url(UnsafePointer<Int8>) -> nw_endpoint_t

Creates a network endpoint with a URL string.

func nw_endpoint_get_address(nw_endpoint_t) -> UnsafePointer<sockaddr>

Accesses the address structure stored in an address endpoint.

func nw_endpoint_get_bonjour_service_domain(nw_endpoint_t) -> UnsafePointer<Int8>

Accesses the Bonjour service domain stored in an endpoint.

func nw_endpoint_get_bonjour_service_name(nw_endpoint_t) -> UnsafePointer<Int8>

Accesses the Bonjour service name stored in an endpoint.

func nw_endpoint_get_bonjour_service_type(nw_endpoint_t) -> UnsafePointer<Int8>

Accesses the Bonjour service type stored in an endpoint.

func nw_endpoint_get_port(nw_endpoint_t) -> UInt16

Accesses the port stored in an endpoint, in host-byte order.

func nw_endpoint_get_url(nw_endpoint_t) -> UnsafePointer<Int8>

Accesses the URL string stored in an endpoint.

func nw_error_copy_cf_error(nw_error_t) -> Unmanaged<CFError>

Copies out a CFError that represents a network error.

func nw_error_get_error_code(nw_error_t) -> Int32

Accesses the specific code of the network error.

func nw_establishment_report_enumerate_protocols(nw_establishment_report_t, (nw_protocol_definition_t, UInt64, UInt64) -> Bool)

Iterates a list of protocol handshakes in order from first completed to last completed.

func nw_establishment_report_enumerate_resolutions(nw_establishment_report_t, (nw_report_resolution_source_t, UInt64, UInt32, nw_endpoint_t, nw_endpoint_t) -> Bool)

Iterates a list of resolution steps performed during connection establishment, in order from first resolved to last resolved.

func nw_establishment_report_get_attempt_started_after_milliseconds(nw_establishment_report_t) -> UInt64

Accesses the time between the call to start and the beginning of the successful connection attempt, in milliseconds.

func nw_establishment_report_get_duration_milliseconds(nw_establishment_report_t) -> UInt64

Checks the total duration of the successful connection establishment attempt, from the preparing state to the ready state.

func nw_establishment_report_get_previous_attempt_count(nw_establishment_report_t) -> UInt32

Checks the number of attempts made before the successful attempt, when the connection moved from the preparing state back to the waiting state.

func nw_establishment_report_get_proxy_configured(nw_establishment_report_t) -> Bool

Checks whether a proxy was configured on the connection.

func nw_ethernet_channel_cancel(nw_ethernet_channel_t)

Unregisters the channel from the interface.

func nw_ethernet_channel_create(UInt16, nw_interface_t) -> nw_ethernet_channel_t

Initializes an Ethernet channel on a specific interface with a custom Ethernet type.

func nw_ethernet_channel_set_queue(nw_ethernet_channel_t, DispatchQueue)

Sets the queue on which all channel events are delivered.

func nw_ethernet_channel_start(nw_ethernet_channel_t)

Starts the process of registering the channel.

func nw_framer_async(nw_framer_t, nw_framer_block_t)

Requests that a block be executed on the connection's internal scheduling context.

func nw_framer_copy_local_endpoint(nw_framer_t) -> nw_endpoint_t

Accesses the local endpoint of the connection in which your protocol is running.

func nw_framer_copy_parameters(nw_framer_t) -> nw_parameters_t

Accesses the parameters of the connection in which your protocol is running.

func nw_framer_copy_remote_endpoint(nw_framer_t) -> nw_endpoint_t

Accesses the remote endpoint of the connection in which your protocol is running.

func nw_framer_create_options(nw_protocol_definition_t) -> nw_protocol_options_t

Initializes a set of protocol options with a custom framer definition.

func nw_framer_deliver_input(nw_framer_t, UnsafePointer<UInt8>, Int, nw_framer_message_t, Bool)

Delivers an inbound message containing arbitrary data from your protocol to the application.

func nw_framer_deliver_input_no_copy(nw_framer_t, Int, nw_framer_message_t, Bool) -> Bool

Delivers an inbound message containing a specific number of next received bytes.

func nw_framer_mark_failed_with_error(nw_framer_t, Int32)

Indicates to a connection that your protocol has encountered an error, or has gracefully closed.

func nw_framer_mark_ready(nw_framer_t)

Indicates to a connection that your protocol's handshake is complete.

func nw_framer_message_create(nw_framer_t) -> nw_framer_message_t

Initializes an empty message from within a framer implementation.

func nw_framer_message_set_value(nw_framer_message_t, UnsafePointer<Int8>, UnsafeMutableRawPointer?, nw_framer_message_dispose_value_t?)

Sets a value to be stored in a framer message, with a completion to call to disposed the stored value when the message is released.

func nw_framer_pass_through_input(nw_framer_t)

Indicates that your protocol no longer needs to handle input data.

func nw_framer_pass_through_output(nw_framer_t)

Indicates that your protocol no longer needs to handle output data.

func nw_framer_prepend_application_protocol(nw_framer_t, nw_protocol_options_t) -> Bool

Dynamically adds another protocol that will run above your protocol after your protocol calls nw_framer_mark_ready(_:).

func nw_framer_protocol_create_message(nw_protocol_definition_t) -> nw_framer_message_t

Initializes an empty message for a custom framer definition.

func nw_framer_schedule_wakeup(nw_framer_t, UInt64)

Requests that the nw_framer_wakeup_handler_t be called on your protocol at a specific time in the future.

func nw_framer_set_cleanup_handler(nw_framer_t, nw_framer_cleanup_handler_t)

Sets a block to handle the final cleanup of allocations made by your protocol instance.

func nw_framer_set_stop_handler(nw_framer_t, nw_framer_stop_handler_t)

Sets a block to handle when the connection is being closed.

func nw_framer_set_wakeup_handler(nw_framer_t, nw_framer_wakeup_handler_t)

Sets a handler to receive scheduled wakeup events.

func nw_framer_write_output(nw_framer_t, UnsafePointer<UInt8>, Int)

Sends arbitrary output data in a buffer from your protocol to the next protocol.

func nw_framer_write_output_data(nw_framer_t, __DispatchData)

Sends arbitrary output data from your protocol to the next protocol.

func nw_framer_write_output_no_copy(nw_framer_t, Int) -> Bool

Sends a specific number of bytes from a message while inside your output handler.

func nw_interface_get_index(nw_interface_t) -> UInt32

Accesses the system interface index associated with the interface.

func nw_interface_get_type(nw_interface_t) -> nw_interface_type_t

Accesses the type of the interface, such as Wi-Fi or Loopback.

func nw_ip_create_metadata() -> nw_protocol_metadata_t

Initializes an IP packet configuration with default settings.

func nw_ip_metadata_get_ecn_flag(nw_protocol_metadata_t) -> nw_ip_ecn_flag_t

Checks the Explicit Congestion Notification flag value received on an IP packet.

func nw_ip_metadata_get_receive_time(nw_protocol_metadata_t) -> UInt64

Access the time at which a packet was received, in nanoseconds, based on CLOCK_MONOTONIC_RAW.

func nw_ip_metadata_get_service_class(nw_protocol_metadata_t) -> nw_service_class_t

Accesses a specific service class to mark on an IP packet.

func nw_ip_metadata_set_ecn_flag(nw_protocol_metadata_t, nw_ip_ecn_flag_t)

Sets a specific Explicit Congestion Notification flag value to set on an IP packet.

func nw_ip_metadata_set_service_class(nw_protocol_metadata_t, nw_service_class_t)

Sets a specific service class to mark on an IP packet.

func nw_ip_options_set_calculate_receive_time(nw_protocol_options_t, Bool)

Configures a connection to deliver receive timestamps for IP packets.

func nw_ip_options_set_disable_fragmentation(nw_protocol_options_t, Bool)

Configures a connection to disable fragmentation on outbound packets.

func nw_ip_options_set_hop_limit(nw_protocol_options_t, UInt8)

Configures the default hop limit for packets generated by a connection.

func nw_ip_options_set_local_address_preference(nw_protocol_options_t, nw_ip_local_address_preference_t)

Configures a connection to prefer certain types of local addresses, such as temporary or stable.

func nw_ip_options_set_use_minimum_mtu(nw_protocol_options_t, Bool)

Configures a connection to use the minimum MTU value, which is 1280 bytes for IPv6.

func nw_ip_options_set_version(nw_protocol_options_t, nw_ip_version_t)

Sets a required IP version to disable all other versions for a connection.

func nw_listener_cancel(nw_listener_t)

Stops listening for inbound connections.

func nw_listener_create(nw_parameters_t) -> nw_listener_t?

Initializes a network listener, which will select a random port.

func nw_listener_create_with_connection(nw_connection_t, nw_parameters_t) -> nw_listener_t?

Initializes a network listener to receive new streams on a multiplexed connection.

func nw_listener_get_new_connection_limit(nw_listener_t) -> UInt32

Checks the remaining number of inbound connections to deliver before rejecting connections.

func nw_listener_get_port(nw_listener_t) -> UInt16

The port on which the listener can accept connections.

func nw_listener_set_advertise_descriptor(nw_listener_t, nw_advertise_descriptor_t?)

Sets a Bonjour service that advertises the listener on the local network.

func nw_listener_set_new_connection_limit(nw_listener_t, UInt32)

Resets the number of inbound connections to deliver before rejecting connections.

func nw_listener_set_queue(nw_listener_t, DispatchQueue)

Sets the queue on which all listener events are delivered.

func nw_listener_start(nw_listener_t)

Registers for listening for inbound connections.

func nw_parameters_copy(nw_parameters_t) -> nw_parameters_t

Peforms a deep copy of a parameters object.

func nw_parameters_copy_default_protocol_stack(nw_parameters_t) -> nw_protocol_stack_t

Accesses the protocol stack used by 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_copy_required_interface(nw_parameters_t) -> nw_interface_t?

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

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_get_fast_open_enabled(nw_parameters_t) -> Bool

Checks if sending application data with protocol handshakes is enabled.

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_get_local_only(nw_parameters_t) -> Bool

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

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_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_get_required_interface_type(nw_parameters_t) -> nw_interface_type_t

Accesses the interface type required on connections and listeners.

func nw_parameters_get_reuse_local_address(nw_parameters_t) -> Bool

Checks whether a connection allows reusing local addresses and ports.

func nw_parameters_get_service_class(nw_parameters_t) -> nw_service_class_t

Checks the level of service quality used for connections.

func nw_parameters_prohibit_interface(nw_parameters_t, nw_interface_t)

Prevents connections and listeners from using a specific interface.

func nw_parameters_prohibit_interface_type(nw_parameters_t, nw_interface_type_t)

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

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_set_fast_open_enabled(nw_parameters_t, Bool)

Enables sending application data with protocol handshakes.

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_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_set_local_only(nw_parameters_t, Bool)

Restricts listeners to only accepting connections from the local link.

func nw_parameters_set_multipath_service(nw_parameters_t, nw_multipath_service_t)

Enables multipath protocols to allow connections to use multiple interfaces.

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_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_set_prohibit_expensive(nw_parameters_t, Bool)

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

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_set_reuse_local_address(nw_parameters_t, Bool)

Allows reusing local addresses and ports across connections.

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_path_copy_effective_local_endpoint(nw_path_t) -> nw_endpoint_t?

Accesses the local endpoint in use by a connection's network path.

func nw_path_copy_effective_remote_endpoint(nw_path_t) -> nw_endpoint_t?

Accesses the remote endpoint in use by a connection's network path.

func nw_path_enumerate_gateways(nw_path_t, (nw_endpoint_t) -> Bool)

Enumerates the list of gateways configured on the interfaces available to a path.

func nw_path_enumerate_interfaces(nw_path_t, (nw_interface_t) -> Bool)

Enumerates the list of all interfaces available to the path, in order of preference.

func nw_path_get_status(nw_path_t) -> nw_path_status_t

Checks whether a path can be used by connections.

func nw_path_has_dns(nw_path_t) -> Bool

Checks whether the path has a DNS server configured.

func nw_path_has_ipv4(nw_path_t) -> Bool

Checks whether the path can route IPv4 traffic.

func nw_path_has_ipv6(nw_path_t) -> Bool

Checks whether the path can route IPv6 traffic.

func nw_path_is_constrained(nw_path_t) -> Bool

Checks whether the path uses an interface in Low Data Mode.

func nw_path_is_equal(nw_path_t, nw_path_t) -> Bool

Compares if two paths are identical.

func nw_path_is_expensive(nw_path_t) -> Bool

Checks whether the path uses an interface that is considered expensive, such as Cellular or a Personal Hotspot.

func nw_path_monitor_cancel(nw_path_monitor_t)

Stops receiving network path updates.

func nw_path_monitor_create() -> nw_path_monitor_t

Initializes a path monitor to observe all available interface types.

func nw_path_monitor_create_with_type(nw_interface_type_t) -> nw_path_monitor_t

Initializes a path monitor to observe a specific interface type.

func nw_path_monitor_set_cancel_handler(nw_path_monitor_t, nw_path_monitor_cancel_handler_t)

Sets a handler to determine when a monitor is fully cancelled and will no longer deliver events.

func nw_path_monitor_set_queue(nw_path_monitor_t, DispatchQueue)

Sets a queue on which to deliver path events.

func nw_path_monitor_start(nw_path_monitor_t)

Starts monitoring path changes.

func nw_path_uses_interface_type(nw_path_t, nw_interface_type_t) -> Bool

Checks if connections using the path may send traffic over a specific interface type.

func nw_protocol_copy_ip_definition() -> nw_protocol_definition_t

Accesses the system definition of the Internet Protocol.

func nw_protocol_copy_tcp_definition() -> nw_protocol_definition_t

Accesses the system definition of the Transport Control Protocol.

func nw_protocol_copy_tls_definition() -> nw_protocol_definition_t

Accesses the system definition of the Transport Layer Security protocol.

func nw_protocol_copy_udp_definition() -> nw_protocol_definition_t

Accesses the system definition of the User Datagram Protocol.

func nw_protocol_copy_ws_definition() -> nw_protocol_definition_t

Accesses the system definition of the WebSocket protocol.

func nw_protocol_definition_is_equal(nw_protocol_definition_t, nw_protocol_definition_t) -> Bool

Compares two protocol definitions, and returns true if they represent the same protocol implementation.

func nw_protocol_metadata_copy_definition(nw_protocol_metadata_t) -> nw_protocol_definition_t

Accesses the protocol definition associated with the metadata object.

func nw_protocol_metadata_is_framer_message(nw_protocol_metadata_t) -> Bool

Checks if a metadata object represents a custom framer protocol message.

func nw_protocol_metadata_is_ip(nw_protocol_metadata_t) -> Bool

Checks whether a metadata object represents an IP packet.

func nw_protocol_metadata_is_tcp(nw_protocol_metadata_t) -> Bool

Checks whether a metadata object contains TCP connection state.

func nw_protocol_metadata_is_tls(nw_protocol_metadata_t) -> Bool

Checks whether a metadata object contains TLS connection state.

func nw_protocol_metadata_is_udp(nw_protocol_metadata_t) -> Bool

Checks whether a metadata object represents a UDP datagram.

func nw_protocol_metadata_is_ws(nw_protocol_metadata_t) -> Bool

Checks whether a metadata object represents a WebSocket message.

func nw_protocol_options_copy_definition(nw_protocol_options_t) -> nw_protocol_definition_t

Accesses the protocol definition associated with the options object.

func nw_protocol_stack_clear_application_protocols(nw_protocol_stack_t)

Removes all application protocols from the protocol stack.

func nw_protocol_stack_copy_transport_protocol(nw_protocol_stack_t) -> nw_protocol_options_t?

Accesses the options for the protocol stack's transport protocol.

func nw_protocol_stack_iterate_application_protocols(nw_protocol_stack_t, (nw_protocol_options_t) -> Void)

Iterates through the array of application protocol options that will be used by connections and listeners.

func nw_protocol_stack_set_transport_protocol(nw_protocol_stack_t, nw_protocol_options_t)

Replaces the protocol stack's transport protocol with a new set of options.

func nw_tcp_create_options() -> nw_protocol_options_t

Initializes a default set of TCP connection options.

func nw_tcp_get_available_receive_buffer(nw_protocol_metadata_t) -> UInt32

Accesses the number of available bytes in the TCP receive buffer.

func nw_tcp_get_available_send_buffer(nw_protocol_metadata_t) -> UInt32

Accesses the number of available bytes in the TCP send buffer.

func nw_tcp_options_set_connection_timeout(nw_protocol_options_t, UInt32)

Sets the number of seconds that TCP waits before timing out its handshake.

func nw_tcp_options_set_disable_ecn(nw_protocol_options_t, Bool)

Disables negotiation of Explicit Congestion Notification markings.

func nw_tcp_options_set_keepalive_count(nw_protocol_options_t, UInt32)

Sets the number of keepalive probes that TCP sends before terminating the connection.

func nw_tcp_options_set_keepalive_idle_time(nw_protocol_options_t, UInt32)

Sets the number of seconds of idleness that TCP waits before sending keepalive probes.

func nw_tcp_options_set_keepalive_interval(nw_protocol_options_t, UInt32)

Sets the number of seconds that TCP waits between sending keepalive probes.

func nw_tcp_options_set_persist_timeout(nw_protocol_options_t, UInt32)

Sets the TCP persist timeout in seconds, as defined by RFC 6429.

func nw_tcp_options_set_retransmit_connection_drop_time(nw_protocol_options_t, UInt32)

Sets the number of seconds that TCP waits between retransmission attempts.

func nw_tcp_options_set_retransmit_fin_drop(nw_protocol_options_t, Bool)

Causes TCP to drop its connection after not receiving an ACK after a FIN.

func nw_tls_create_options() -> nw_protocol_options_t

Initializes a default set of TLS connection options.

func nw_txt_record_apply(nw_txt_record_t, nw_txt_record_applier_t) -> Bool

Iterates through all keys in a TXT record dictionary.

func nw_txt_record_create_dictionary() -> nw_txt_record_t

Initializes a TXT record as a dictionary of strings.

func nw_txt_record_find_key(nw_txt_record_t, UnsafePointer<Int8>) -> nw_txt_record_find_key_t

Checks the status of value associated with a key in a TXT record dictionary.

func nw_txt_record_get_key_count(nw_txt_record_t?) -> Int

Accesses the number of keys stored in the TXT record dictionary.

func nw_txt_record_is_dictionary(nw_txt_record_t) -> Bool

Checks whether a TXT record conforms to a dictionary format.

func nw_udp_create_options() -> nw_protocol_options_t

Initializes a default set of UDP connection options.

func nw_udp_options_set_prefer_no_checksum(nw_protocol_options_t, Bool)

Configures the connection to not send UDP checksums.

func nw_ws_create_metadata(nw_ws_opcode_t) -> nw_protocol_metadata_t

Initializes a WebSocket message with a specific type code.

func nw_ws_create_options(nw_ws_version_t) -> nw_protocol_options_t

Initializes a default set of WebSocket connection options.

func nw_ws_metadata_copy_server_response(nw_protocol_metadata_t) -> nw_ws_response_t

Accesses the WebSocket server's response sent during the handshake.

func nw_ws_metadata_set_pong_handler(nw_protocol_metadata_t, DispatchQueue, nw_ws_pong_handler_t)

Sets a handler on a Ping message to be invoked when the corresponding Pong message is received.

func nw_ws_options_add_additional_header(nw_protocol_options_t, UnsafePointer<Int8>, UnsafePointer<Int8>)

Adds additional HTTP header fields to be sent by the client during the WebSocket handshake.

func nw_ws_options_add_subprotocol(nw_protocol_options_t, UnsafePointer<Int8>)

Adds to the list of supported application protocols that will be presented to a WebSocket server during connection establishment.

func nw_ws_options_set_auto_reply_ping(nw_protocol_options_t, Bool)

Configures the connection to automatically reply to Ping messages instead of delivering them to you.

func nw_ws_options_set_client_request_handler(nw_protocol_options_t, DispatchQueue, nw_ws_client_request_handler_t)

Sets a handler to react to as a server to inbound WebSocket client handshakes.

func nw_ws_options_set_maximum_message_size(nw_protocol_options_t, Int)

Sets the maximum allowed message size, in bytes, to be received by the WebSocket connection.

func nw_ws_options_set_skip_handshake(nw_protocol_options_t, Bool)

Specifies whether the WebSocket protocol skips its handshake and begins framing data once the underlying connection is established.

func nw_ws_response_create(nw_ws_response_status_t, UnsafePointer<Int8>?) -> nw_ws_response_t

Initializes a WebSocket server response with a status and selected subprotocol.

func nw_ws_response_get_selected_subprotocol(nw_ws_response_t) -> UnsafePointer<Int8>?

Accesses the selected subprotocol in a WebSocket server response.

func nw_ws_response_get_status(nw_ws_response_t?) -> nw_ws_response_status_t

Accesses the status of a WebSocket server response.