Package apple.network.c
Class Network
- java.lang.Object
-
- apple.network.c.Network
-
public final class Network extends java.lang.Object
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description static doubleNW_FRAMER_CREATE_FLAGS_DEFAULTstatic doubleNW_NOT_i386_MAC
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull nw_content_context_t_nw_content_context_default_message()API-Since: 12.0static @NotNull nw_content_context_t_nw_content_context_default_stream()API-Since: 12.0static @NotNull nw_content_context_t_nw_content_context_final_send()API-Since: 12.0static int_nw_data_transfer_report_all_paths()[@const] NW_ALL_PATHS Pass NW_ALL_PATHS to data transfer report accessors to sum values across paths where applicable.static @NotNull nw_privacy_context_t_nw_privacy_context_default_context()API-Since: 14.0static @NotNull CFStringRefkNWErrorDomainDNS()Values will be DNSServiceErrorType errors API-Since: 12.0static @NotNull CFStringRefkNWErrorDomainPOSIX()Values will be POSIX errors API-Since: 12.0static @NotNull CFStringRefkNWErrorDomainTLS()Values will be errSSL* errors API-Since: 12.0static @Nullable nw_txt_record_tnw_advertise_descriptor_copy_txt_record_object(@NotNull nw_advertise_descriptor_t advertise_descriptor)[@function] nw_advertise_descriptor_copy_txt_record_object Copies the TXT record object from the advertise descriptor.static @NotNull nw_advertise_descriptor_tnw_advertise_descriptor_create_application_service(@NotNull java.lang.String application_service_name)[@function] nw_advertise_descriptor_create_application_service Creates an advertise descriptor for application service discovery.static @Nullable nw_advertise_descriptor_tnw_advertise_descriptor_create_bonjour_service(@Nullable java.lang.String name, @NotNull java.lang.String type, @Nullable java.lang.String domain)[@function] nw_advertise_descriptor_create_bonjour_service Creates a new advertise descriptor object based on a Bonjour service type and optional domain.static @Nullable java.lang.Stringnw_advertise_descriptor_get_application_service_name(@NotNull nw_advertise_descriptor_t advertise_descriptor)[@function] nw_advertise_descriptor_get_application_service_name Returns the service name of an application service advertise descriptor.static booleannw_advertise_descriptor_get_no_auto_rename(@NotNull nw_advertise_descriptor_t advertise_descriptor)[@function] nw_advertise_descriptor_get_no_auto_rename Check if auto-rename has been disabled for the Bonjour service registration.static voidnw_advertise_descriptor_set_no_auto_rename(@NotNull nw_advertise_descriptor_t advertise_descriptor, boolean no_auto_rename)[@function] nw_advertise_descriptor_set_no_auto_rename Disable auto-rename for the Bonjour service registration.static voidnw_advertise_descriptor_set_txt_record(@NotNull nw_advertise_descriptor_t advertise_descriptor, @Nullable org.moe.natj.general.ptr.ConstVoidPtr txt_record, long txt_length)[@function] nw_advertise_descriptor_set_txt_record Set the TXT record for the advertise descriptor's service.static voidnw_advertise_descriptor_set_txt_record_object(@NotNull nw_advertise_descriptor_t advertise_descriptor, @Nullable nw_txt_record_t txt_record)[@function] nw_advertise_descriptor_set_txt_record_object Set the TXT record object on the advertise descriptor.static @NotNull nw_browse_descriptor_tnw_browse_descriptor_create_application_service(@NotNull java.lang.String application_service_name)[@function] nw_browse_descriptor_create_application_service Creates a browse descriptor for application service discovery.static @NotNull nw_browse_descriptor_tnw_browse_descriptor_create_bonjour_service(@NotNull java.lang.String type, @Nullable java.lang.String domain)[@function] nw_browse_descriptor_create_bonjour_service Creates a new browse descriptor object on a Bonjour service type and domain.static @Nullable java.lang.Stringnw_browse_descriptor_get_application_service_name(@NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_application_service_name Returns the service name of an application service browse descriptor.static @Nullable java.lang.Stringnw_browse_descriptor_get_bonjour_service_domain(@NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_bonjour_service_domain Returns the service domain of a browse descriptor, or NULL if NULL was provided while creating the descriptor.static @NotNull java.lang.Stringnw_browse_descriptor_get_bonjour_service_type(@NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_bonjour_service_type Returns the service type of a browse descriptor.static booleannw_browse_descriptor_get_include_txt_record(@NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_include_txt_record Check whether the browser is allowed to query for TXT records.static voidnw_browse_descriptor_set_include_txt_record(@NotNull nw_browse_descriptor_t descriptor, boolean include_txt_record)[@function] nw_browse_descriptor_set_include_txt_record Set a flag to allow or prohibit the browser from querying for TXT records while browsing.static @NotNull nw_endpoint_tnw_browse_result_copy_endpoint(@NotNull nw_browse_result_t result)[@function] nw_browse_result_copy_endpoint Copies the endpoint associated with the browse result object.static @Nullable nw_txt_record_tnw_browse_result_copy_txt_record_object(@NotNull nw_browse_result_t result)[@function] nw_browse_result_copy_txt_record_object Copies the TXT record object from the browse result.static voidnw_browse_result_enumerate_interfaces(@NotNull nw_browse_result_t result, @NotNull Network.Block_nw_browse_result_enumerate_interfaces enumerator)[@function] nw_browse_result_enumerate_interfaces Enumerates the list of interfaces on this browse result.static longnw_browse_result_get_changes(@Nullable nw_browse_result_t old_result, @Nullable nw_browse_result_t new_result)[@function] nw_browse_result_get_changes Determines the set of all changes that occurred between an old and a new browse result.static longnw_browse_result_get_interfaces_count(@NotNull nw_browse_result_t result)[@function] nw_browse_result_get_interfaces_count Returns the number of interfaces on this browse result.static voidnw_browser_cancel(@NotNull nw_browser_t browser)[@function] nw_browser_cancel Cancels the browser.static @NotNull nw_browse_descriptor_tnw_browser_copy_browse_descriptor(@NotNull nw_browser_t browser)[@function] nw_browser_copy_browse_descriptor Returns a copy of the browse_descriptor passed to nw_browser_create().static @NotNull nw_parameters_tnw_browser_copy_parameters(@NotNull nw_browser_t browser)[@function] nw_browser_copy_parameters Returns a copy of the parameters passed to nw_browser_create().static @NotNull nw_browser_tnw_browser_create(@NotNull nw_browse_descriptor_t descriptor, @Nullable nw_parameters_t parameters)[@function] nw_browser_create Creates a new browser object, which can be used to browse for results matching a browse descriptor.static voidnw_browser_set_browse_results_changed_handler(@NotNull nw_browser_t browser, @Nullable Network.Block_nw_browser_set_browse_results_changed_handler handler)[@function] nw_browser_set_browse_results_changed_handler Sets a callback handler to be invoked when the browser gets an update for changed browse results.static voidnw_browser_set_queue(@NotNull nw_browser_t browser, @NotNull dispatch_queue_t queue)[@function] nw_browser_set_queue Sets the client callback queue, on which blocks for events will be scheduled.static voidnw_browser_set_state_changed_handler(@NotNull nw_browser_t browser, @Nullable Network.Block_nw_browser_set_state_changed_handler state_changed_handler)[@function] nw_browser_set_state_changed_handler Sets the state changed handler.static voidnw_browser_start(@NotNull nw_browser_t browser)[@function] nw_browser_start Starts the browser, which begins browsing for available endpoints.static voidnw_connection_access_establishment_report(@NotNull nw_connection_t connection, @NotNull dispatch_queue_t queue, @NotNull Network.Block_nw_connection_access_establishment_report access_block)[@function] nw_connection_access_establishment_report Access the establishment report for a connection.static voidnw_connection_batch(@NotNull nw_connection_t connection, @NotNull Network.Block_nw_connection_batch batch_block)[@function] nw_connection_batch Batch several send and/or receive operations together, to hint to the connection that multiple send or receive operations are expected in quick succession.static voidnw_connection_cancel(@NotNull nw_connection_t connection)[@function] nw_connection_cancel Cancel the connection.static voidnw_connection_cancel_current_endpoint(@NotNull nw_connection_t connection)[@function] nw_connection_cancel_current_endpoint Cancel the currently connected endpoint, causing the connection to fall through to the next endpoint if available, or fail if no more endpoints are available.static @Nullable nw_path_tnw_connection_copy_current_path(@NotNull nw_connection_t connection)[@function] nw_connection_copy_current_path Copy the current path for a connection.static @NotNull org.moe.natj.general.ptr.BytePtrnw_connection_copy_description(@NotNull nw_connection_t connection)[@function] nw_connection_copy_description Copy a human-readable description of the connection.static @NotNull nw_endpoint_tnw_connection_copy_endpoint(@NotNull nw_connection_t connection)[@function] nw_connection_copy_endpoint Retrieves the remote endpoint for a connection.static @NotNull nw_parameters_tnw_connection_copy_parameters(@NotNull nw_connection_t connection)[@function] nw_connection_copy_parameters Retrieves the parameters for a connection.static @Nullable nw_protocol_metadata_tnw_connection_copy_protocol_metadata(@NotNull nw_connection_t connection, @NotNull nw_protocol_definition_t definition)[@function] nw_connection_copy_protocol_metadata Copy the connection-wide metadata for a specific protocol.static @NotNull nw_connection_tnw_connection_create(@NotNull nw_endpoint_t endpoint, @NotNull nw_parameters_t parameters)[@function] nw_connection_create Creates a networking connection to an endpoint.static @NotNull nw_data_transfer_report_tnw_connection_create_new_data_transfer_report(@NotNull nw_connection_t connection)[@function] nw_connection_create_new_data_transfer_report Create a new data transfer report on a connection.static voidnw_connection_force_cancel(@NotNull nw_connection_t connection)[@function] nw_connection_force_cancel A variant of nw_connection_cancel() that indicates that the protocol stack should not close gracefully, but close as quickly as possible without negotiation.static intnw_connection_get_maximum_datagram_size(@NotNull nw_connection_t connection)[@function] nw_connection_get_maximum_datagram_size Check for the maximum datagram size that can be written on the connection.static voidnw_connection_group_cancel(@NotNull nw_connection_group_t group)[@function] nw_connection_group_cancel Cancels the connection group.static @NotNull nw_group_descriptor_tnw_connection_group_copy_descriptor(@NotNull nw_connection_group_t group)[@function] nw_connection_group_copy_descriptor Gets the group descriptor with which the connection group was created.static @Nullable nw_endpoint_tnw_connection_group_copy_local_endpoint_for_message(@NotNull nw_connection_group_t group, @NotNull nw_content_context_t context)[@function] nw_connection_group_copy_local_endpoint_for_message Copy the local endpoint corresponding to a given inbound connection group message.static @NotNull nw_parameters_tnw_connection_group_copy_parameters(@NotNull nw_connection_group_t group)[@function] nw_connection_group_copy_parameters Returns a copy of the parameters passed to nw_connection_group_create.static @Nullable nw_path_tnw_connection_group_copy_path_for_message(@NotNull nw_connection_group_t group, @NotNull nw_content_context_t context)[@function] nw_connection_group_copy_path_for_message Copy the path associated with a given inbound connection group message.static @Nullable nw_protocol_metadata_tnw_connection_group_copy_protocol_metadata(@NotNull nw_connection_group_t group, @NotNull nw_protocol_definition_t definition)[@function] nw_connection_group_copy_protocol_metadata Copy the metadata corresponding to a given inbound connection group message.static @Nullable nw_protocol_metadata_tnw_connection_group_copy_protocol_metadata_for_message(@NotNull nw_connection_group_t group, @NotNull nw_content_context_t context, @NotNull nw_protocol_definition_t definition)[@function] nw_connection_group_copy_protocol_metadata_for_message Copy the metadata corresponding to a given inbound connection group message.static @Nullable nw_endpoint_tnw_connection_group_copy_remote_endpoint_for_message(@NotNull nw_connection_group_t group, @NotNull nw_content_context_t context)[@function] nw_connection_group_copy_remote_endpoint_for_message Copy the remote endpoint corresponding to a given inbound connection group message.static @NotNull nw_connection_group_tnw_connection_group_create(@NotNull nw_group_descriptor_t group_descriptor, @NotNull nw_parameters_t parameters)[@function] nw_connection_group_create Creates a new connection group object to use for communication with a group descriptor using protocols described by parameters.static @Nullable nw_connection_tnw_connection_group_extract_connection(@NotNull nw_connection_group_t group, @Nullable nw_endpoint_t endpoint, @Nullable nw_protocol_options_t protocol_options)[@function] nw_connection_group_extract_connection Extract a connection from the connection group.static @Nullable nw_connection_tnw_connection_group_extract_connection_for_message(@NotNull nw_connection_group_t group, @NotNull nw_content_context_t context)[@function] nw_connection_group_extract_connection_for_message Extract a connection corresponding to an inbound message from the connection group.static booleannw_connection_group_reinsert_extracted_connection(@NotNull nw_connection_group_t group, @NotNull nw_connection_t connection)[@function] nw_connection_group_reinsert_extracted_connection Reinsert a connection into a connection group.static voidnw_connection_group_reply(@NotNull nw_connection_group_t group, @NotNull nw_content_context_t inbound_message, @NotNull nw_content_context_t outbound_message, @Nullable dispatch_data_t content)[@function] nw_connection_group_reply Send data in response to an inbound message received by a connection group.static voidnw_connection_group_send_message(@NotNull nw_connection_group_t group, @Nullable dispatch_data_t content, @Nullable nw_endpoint_t endpoint, @NotNull nw_content_context_t context, @NotNull Network.Block_nw_connection_group_send_message completion)[@function] nw_connection_group_send_message Send data that is not in response to an inbound message.static voidnw_connection_group_set_new_connection_handler(@NotNull nw_connection_group_t group, @Nullable Network.Block_nw_connection_group_set_new_connection_handler new_connection_handler)[@function] nw_connection_group_set_new_connection_handler Sets the new connection handler to be invoked whenever a new inbound connection is received by the connection group.static voidnw_connection_group_set_queue(@NotNull nw_connection_group_t group, @NotNull dispatch_queue_t queue)[@function] nw_connection_group_set_queue Sets the client callback queue, on which blocks for events will be scheduled.static voidnw_connection_group_set_receive_handler(@NotNull nw_connection_group_t group, int maximum_message_size, boolean reject_oversized_messages, @Nullable Network.Block_nw_connection_group_set_receive_handler receive_handler)[@function] nw_connection_group_set_receive_handler Sets the handler to be invoked whenever a new inbound message arrives at the connection group.static voidnw_connection_group_set_state_changed_handler(@NotNull nw_connection_group_t group, @Nullable Network.Block_nw_connection_group_set_state_changed_handler state_changed_handler)[@function] nw_connection_group_set_state_changed_handler Sets the state changed handler.static voidnw_connection_group_start(@NotNull nw_connection_group_t group)[@function] nw_connection_group_start Starts the connection group, which begins listening for and processing incoming messages.static voidnw_connection_receive(@NotNull nw_connection_t connection, int minimum_incomplete_length, int maximum_length, @NotNull Network.Block_nw_connection_receive completion)[@function] nw_connection_receive Receive data from a connection.static voidnw_connection_receive_message(@NotNull nw_connection_t connection, @NotNull Network.Block_nw_connection_receive_message completion)[@function] nw_connection_receive_message Receive a single atomic message from a connection.static voidnw_connection_restart(@NotNull nw_connection_t connection)[@function] nw_connection_restart Connections in the waiting state will normally re-attempt on network changes.static voidnw_connection_send(@NotNull nw_connection_t connection, @Nullable dispatch_data_t content, @NotNull nw_content_context_t context, boolean is_complete, @NotNull Network.Block_nw_connection_send completion)[@function] nw_connection_send Send data on a connection.static voidnw_connection_set_better_path_available_handler(@NotNull nw_connection_t connection, @Nullable Network.Block_nw_connection_set_better_path_available_handler handler)[@function] nw_connection_set_better_path_available_handler Define a callback to be fired when a better path is available or not.static voidnw_connection_set_path_changed_handler(@NotNull nw_connection_t connection, @Nullable Network.Block_nw_connection_set_path_changed_handler handler)[@function] nw_connection_set_path_changed_handler Define a callback to be fired when the connection's path changes.static voidnw_connection_set_queue(@NotNull nw_connection_t connection, @NotNull dispatch_queue_t queue)[@function] nw_connection_set_queue Sets the client callback queue, on which blocks for events will be scheduled.static voidnw_connection_set_state_changed_handler(@NotNull nw_connection_t connection, @Nullable Network.Block_nw_connection_set_state_changed_handler handler)[@function] nw_connection_set_state_changed_handler Sets the state change handler.static voidnw_connection_set_viability_changed_handler(@NotNull nw_connection_t connection, @Nullable Network.Block_nw_connection_set_viability_changed_handler handler)[@function] nw_connection_set_viability_changed_handler Define a callback to be fired when the viability of the connection changes.static voidnw_connection_start(@NotNull nw_connection_t connection)[@function] nw_connection_start Starts the connection, which will cause the connection to evaluate its path, do resolution, and try to become readable and writable.static @Nullable nw_content_context_tnw_content_context_copy_antecedent(@NotNull nw_content_context_t context)[@function] nw_content_context_copy_antecedent Copy the optional content context that must be sent prior to this content.static @Nullable nw_protocol_metadata_tnw_content_context_copy_protocol_metadata(@NotNull nw_content_context_t context, @NotNull nw_protocol_definition_t protocol)[@function] nw_content_context_copy_protocol_metadata Copy the per-protocol metadata from a parent content contextstatic @NotNull nw_content_context_tnw_content_context_create(@NotNull java.lang.String context_identifier)[@function] nw_content_context_create Create a context object to represent properties associated with networking content.static voidnw_content_context_foreach_protocol_metadata(@NotNull nw_content_context_t context, @NotNull Network.Block_nw_content_context_foreach_protocol_metadata foreach_block)[@function] nw_content_context_foreach_protocol_metadata Access all per-protocol metadata objects from a parent content contextstatic longnw_content_context_get_expiration_milliseconds(@NotNull nw_content_context_t context)[@function] nw_content_context_get_expiration_milliseconds Retrieve the number of milliseconds after which the content will expire.static @NotNull java.lang.Stringnw_content_context_get_identifier(@NotNull nw_content_context_t context)[@function] nw_content_context_get_identifier Access the identifier description.static booleannw_content_context_get_is_final(@NotNull nw_content_context_t context)[@function] nw_content_context_get_is_final Check if this is the final context for a connection.static doublenw_content_context_get_relative_priority(@NotNull nw_content_context_t context)[@function] nw_content_context_get_relative_priority Get the relative priority for the content.static voidnw_content_context_set_antecedent(@NotNull nw_content_context_t context, @Nullable nw_content_context_t antecedent_context)[@function] nw_content_context_set_antecedent Set a context as an antecedent to this content context.static voidnw_content_context_set_expiration_milliseconds(@NotNull nw_content_context_t context, long expiration_milliseconds)[@function] nw_content_context_set_expiration_milliseconds Set an expiration (in milliseconds) after which content may be dropped.static voidnw_content_context_set_is_final(@NotNull nw_content_context_t context, boolean is_final)[@function] nw_content_context_set_is_final Mark whether or not this context is the final context for a connection.static voidnw_content_context_set_metadata_for_protocol(@NotNull nw_content_context_t context, @NotNull nw_protocol_metadata_t protocol_metadata)[@function] nw_content_context_set_metadata_for_protocol Set protocol-specific metadata to a parent content context.static voidnw_content_context_set_relative_priority(@NotNull nw_content_context_t context, double relative_priority)[@function] nw_content_context_set_relative_priority Set A relative priority of the content, compared to other content on the same connection.static voidnw_data_transfer_report_collect(@NotNull nw_data_transfer_report_t report, @NotNull dispatch_queue_t queue, @NotNull Network.Block_nw_data_transfer_report_collect collect_block)[@function] nw_data_transfer_report_collect Mark a data transfer report as complete, and request collection of values.static @NotNull nw_interface_tnw_data_transfer_report_copy_path_interface(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_copy_path_interface Retrieve the interface used for data transfer for a given path used by a connection.static longnw_data_transfer_report_get_duration_milliseconds(@NotNull nw_data_transfer_report_t report)[@function] nw_data_transfer_report_get_duration_milliseconds Retrieve the duration of the data transfer report.static intnw_data_transfer_report_get_path_count(@NotNull nw_data_transfer_report_t report)[@function] nw_data_transfer_report_get_path_count Retrieve the number of paths used by the connection for the duration of the report.static intnw_data_transfer_report_get_path_radio_type(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_path_radio_type Retrieve the radio type used for data transfer for a given path used by a connection.static longnw_data_transfer_report_get_received_application_byte_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_application_byte_count Retrieve the number of application bytes received on a given path for the duration of the report.static longnw_data_transfer_report_get_received_ip_packet_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_ip_packet_count Retrieve the number of IP packets received on a given path for the duration of the report.static longnw_data_transfer_report_get_received_transport_byte_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_transport_byte_count Retrieve the number of transport protocol bytes (such as TCP stream bytes) received on a given path for the duration of the report.static longnw_data_transfer_report_get_received_transport_duplicate_byte_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_transport_duplicate_byte_count Retrieve the number of duplicate transport protocol bytes (such as duplicate TCP bytes) received on a given path for the duration of the report.static longnw_data_transfer_report_get_received_transport_out_of_order_byte_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_transport_out_of_order_byte_count Retrieve the number of out-of-order transport protocol bytes (such as out-of-order TCP bytes) received on a given path for the duration of the report.static longnw_data_transfer_report_get_sent_application_byte_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_application_byte_count Retrieve the number of application bytes sent on a given path for the duration of the report.static longnw_data_transfer_report_get_sent_ip_packet_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_ip_packet_count Retrieve the number of IP packets sent on a given path for the duration of the report.static longnw_data_transfer_report_get_sent_transport_byte_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_transport_byte_count Retrieve the number of transport protocol bytes (such as TCP stream bytes) sent on a given path for the duration of the report.static longnw_data_transfer_report_get_sent_transport_retransmitted_byte_count(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_transport_retransmitted_byte_count Retrieve the number of retransmitted transport protocol bytes (such as retransmitted TCP bytes) sent on a given path for the duration of the report.static intnw_data_transfer_report_get_state(@NotNull nw_data_transfer_report_t report)[@function] nw_data_transfer_report_get_state Access the state of a data transfer report.static longnw_data_transfer_report_get_transport_minimum_rtt_milliseconds(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_transport_minimum_rtt_milliseconds Retrieve the minimum (best) round trip time (RTT) on a given path for the duration of the report, measured in milliseconds.static longnw_data_transfer_report_get_transport_rtt_variance(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_transport_rtt_variance Retrieve the variance of the round trip time (RTT) on a given path for the duration of the report.static longnw_data_transfer_report_get_transport_smoothed_rtt_milliseconds(@NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds Retrieve the smoothed average for the transport protocol's round trip time (RTT) on a given path for the duration of the report, measured in milliseconds.static @NotNull org.moe.natj.general.ptr.BytePtrnw_endpoint_copy_address_string(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_copy_address_string Returns an allocated IP address string for a network endpoint with the type nw_endpoint_type_address.static @NotNull org.moe.natj.general.ptr.BytePtrnw_endpoint_copy_port_string(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_copy_port_string Returns an allocated port string for a network endpoint with the type nw_endpoint_type_host or nw_endpoint_type_address.static @Nullable nw_txt_record_tnw_endpoint_copy_txt_record(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_copy_txt_record Retrieves the TXT record associated with the endpoint, if present.static @NotNull nw_endpoint_tnw_endpoint_create_address(@NotNull sockaddr address)[@function] nw_endpoint_create_address Creates a network endpoint with a sockaddr struct.static @NotNull nw_endpoint_tnw_endpoint_create_bonjour_service(@NotNull java.lang.String name, @NotNull java.lang.String type, @NotNull java.lang.String domain)[@function] nw_endpoint_create_bonjour_service Creates a network endpoint for a Bonjour Service name, type, and domain.static @NotNull nw_endpoint_tnw_endpoint_create_host(@NotNull java.lang.String hostname, @NotNull java.lang.String port)[@function] nw_endpoint_create_host Creates a network endpoint with a hostname and port.static @NotNull nw_endpoint_tnw_endpoint_create_url(@NotNull java.lang.String url)[@function] nw_endpoint_create_url Creates a network endpoint with a URL.static @NotNull sockaddrnw_endpoint_get_address(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_address Retrieves the sockaddr struct for a network endpoint with the type nw_endpoint_type_address.static @NotNull java.lang.Stringnw_endpoint_get_bonjour_service_domain(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_bonjour_service_domain Retrieves the Bonjour Service domain string for a network endpoint with the type nw_endpoint_type_bonjour_service.static @NotNull java.lang.Stringnw_endpoint_get_bonjour_service_name(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_bonjour_service_name Retrieves the Bonjour Service name string for a network endpoint with the type nw_endpoint_type_bonjour_service.static @NotNull java.lang.Stringnw_endpoint_get_bonjour_service_type(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_bonjour_service_type Retrieves the Bonjour Service type string for a network endpoint with the type nw_endpoint_type_bonjour_service.static @NotNull java.lang.Stringnw_endpoint_get_hostname(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_hostname Retrieves the hostname string for a network endpoint with the type nw_endpoint_type_host or nw_endpoint_type_url.static charnw_endpoint_get_port(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_port Retrieves the port for a network endpoint with the type nw_endpoint_type_url, nw_endpoint_type_host, or nw_endpoint_type_address.static @Nullable java.lang.Stringnw_endpoint_get_signature(@NotNull nw_endpoint_t endpoint, @NotNull org.moe.natj.general.ptr.NUIntPtr out_signature_length)[@function] nw_endpoint_get_signature Retrieves a signed data blob associated with an endpoint.static intnw_endpoint_get_type(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_type Retrieves the type of a network endpoint.static @NotNull java.lang.Stringnw_endpoint_get_url(@NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_url Retrieves the URL string from a network endpoint of type nw_endpoint_type_url.static @NotNull CFErrorRefnw_error_copy_cf_error(@NotNull nw_error_t error)[@function] nw_error_copy_cf_error Given a reference to nw_error, returns a CFErrorRef representing the same error.static intnw_error_get_error_code(@NotNull nw_error_t error)[@function] nw_error_get_error_code Given a reference to a nw_error, returns the error code.static intnw_error_get_error_domain(@NotNull nw_error_t error)[@function] nw_error_get_error_domain Given a reference to a nw_error, returns the error domain.static @Nullable nw_endpoint_tnw_establishment_report_copy_proxy_endpoint(@NotNull nw_establishment_report_t report)[@function] nw_establishment_report_copy_proxy_endpoint Access the endpoint of the proxy used by a connection, if applicable.static voidnw_establishment_report_enumerate_protocols(@NotNull nw_establishment_report_t report, @NotNull Network.Block_nw_establishment_report_enumerate_protocols enumerate_block)[@function] nw_establishment_report_enumerate_protocols Enumerate the protocols used in the established connection.static voidnw_establishment_report_enumerate_resolution_reports(@NotNull nw_establishment_report_t report, @NotNull Network.Block_nw_establishment_report_enumerate_resolution_reports enumerate_block)[@function] nw_establishment_report_enumerate_resolution_reports Enumerate the steps of connection establishment that involved endpoint resolution, such as DNS hostname resolution and Bonjour service resolution.static voidnw_establishment_report_enumerate_resolutions(@NotNull nw_establishment_report_t report, @NotNull Network.Block_nw_establishment_report_enumerate_resolutions enumerate_block)[@function] nw_establishment_report_enumerate_resolutions Enumerate the steps of connection establishment that involved endpoint resolution, such as DNS hostname resolution and Bonjour service resolution.static longnw_establishment_report_get_attempt_started_after_milliseconds(@NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_attempt_started_after_milliseconds Retrieve the delay from calling start() after which the successful connection attempt began.static longnw_establishment_report_get_duration_milliseconds(@NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_duration_milliseconds Retrieve the duration of the connection's establishment.static intnw_establishment_report_get_previous_attempt_count(@NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_previous_attempt_count Retrieve the number of connection attempts made before the successful attempt.static booleannw_establishment_report_get_proxy_configured(@NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_proxy_configured Check if a proxy configuration applied to the connection, even if the connection did not end up using a proxy for the successful attempt.static booleannw_establishment_report_get_used_proxy(@NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_used_proxy Check if the connection used a proxy during establishment.static voidnw_framer_async(@NotNull nw_framer_t framer, @NotNull Network.Block_nw_framer_async async_block)[@function] nw_framer_async Schedule a block asynchronously on the framer instance.static @NotNull nw_endpoint_tnw_framer_copy_local_endpoint(@NotNull nw_framer_t framer)[@function] nw_framer_copy_local_endpoint Access the local endpoint being used for a given instance of a framer.static @NotNull nw_protocol_options_tnw_framer_copy_options(@NotNull nw_framer_t framer)[@function] nw_framer_copy_options Access the protocol options being used for a given instance of a framer.static @NotNull nw_parameters_tnw_framer_copy_parameters(@NotNull nw_framer_t framer)[@function] nw_framer_copy_parameters Access the parameters being used for a given instance of a framer.static @NotNull nw_endpoint_tnw_framer_copy_remote_endpoint(@NotNull nw_framer_t framer)[@function] nw_framer_copy_remote_endpoint Access the remote endpoint being used for a given instance of a framer.static @NotNull nw_protocol_definition_tnw_framer_create_definition(@NotNull java.lang.String identifier, int flags, @NotNull Network.Block_nw_framer_create_definition start_handler)[@function] nw_framer_create_definition Create a protocol definition for a custom framer protocol.static @NotNull nw_protocol_options_tnw_framer_create_options(@NotNull nw_protocol_definition_t framer_definition)[@function] nw_framer_create_options Create protocol options from a framer definition.static voidnw_framer_deliver_input(@NotNull nw_framer_t framer, @NotNull java.lang.String input_buffer, long input_length, @NotNull nw_protocol_metadata_t message, boolean is_complete)[@function] nw_framer_deliver_input Deliver arbitrary data to the application.static booleannw_framer_deliver_input_no_copy(@NotNull nw_framer_t framer, long input_length, @NotNull nw_protocol_metadata_t message, boolean is_complete)[@function] nw_framer_deliver_input_no_copy Deliver bytes directly to the application without any transformation or copy.static voidnw_framer_mark_failed_with_error(@NotNull nw_framer_t framer, int error_code)[@function] nw_framer_mark_failed_with_error Mark the connection associated with the framer instance as failed (see nw_connection_state_failed).static voidnw_framer_mark_ready(@NotNull nw_framer_t framer)[@function] nw_framer_mark_ready Mark the connection associated with the framer instance as ready (see nw_connection_state_ready).static booleannw_framer_message_access_value(@NotNull nw_protocol_metadata_t message, @NotNull java.lang.String key, @NotNull Network.Block_nw_framer_message_access_value access_value)[@function] nw_framer_message_access_value Access the value with a key on a framer message.static @Nullable java.lang.Objectnw_framer_message_copy_object_value(@NotNull nw_protocol_metadata_t message, @NotNull java.lang.String key)[@function] nw_framer_message_copy_object_value Copy the stored object value using a key on a framer message.static @NotNull nw_protocol_metadata_tnw_framer_message_create(@NotNull nw_framer_t framer)[@function] nw_framer_message_create Create a framer message, given a framer instance.static voidnw_framer_message_set_object_value(@NotNull nw_protocol_metadata_t message, @NotNull java.lang.String key, @Nullable java.lang.Object value)[@function] nw_framer_message_set_object_value Set a key-value pair on a framer message, where the value is a reference-counted object.static voidnw_framer_message_set_value(@NotNull nw_protocol_metadata_t message, @NotNull java.lang.String key, @Nullable org.moe.natj.general.ptr.VoidPtr value, @Nullable Network.Block_nw_framer_message_set_value dispose_value)[@function] nw_framer_message_set_value Set a key-value pair on a framer message, with a custom dispose function for the value.static @Nullable java.lang.Objectnw_framer_options_copy_object_value(@NotNull nw_protocol_options_t options, @NotNull java.lang.String key)[@function] nw_framer_options_copy_object_value Copy the stored object value using a key on framer options.static voidnw_framer_options_set_object_value(@NotNull nw_protocol_options_t options, @NotNull java.lang.String key, @Nullable java.lang.Object value)[@function] nw_framer_options_set_object_value Set a key-value pair on framer options, where the value is a reference-counted object.static booleannw_framer_parse_input(@NotNull nw_framer_t framer, long minimum_incomplete_length, long maximum_length, @Nullable org.moe.natj.general.ptr.BytePtr temp_buffer, @NotNull Network.Block_nw_framer_parse_input parse)[@function] nw_framer_parse_input Parse currently available input from the location of the input cursor in the stream or message being parsed.static booleannw_framer_parse_output(@NotNull nw_framer_t framer, long minimum_incomplete_length, long maximum_length, @Nullable org.moe.natj.general.ptr.BytePtr temp_buffer, @NotNull Network.Block_nw_framer_parse_output parse)[@function] nw_framer_parse_output Parse currently available output from a message from the location of the output cursor in the message being parsed.static voidnw_framer_pass_through_input(@NotNull nw_framer_t framer)[@function] nw_framer_pass_through_input Mark the input side of the framer as a pass-through, which means the framer will not be notified of any further input data.static voidnw_framer_pass_through_output(@NotNull nw_framer_t framer)[@function] nw_framer_pass_through_output Mark the output side of the framer as a pass-through, which means the framer will not be notified of any further output data.static booleannw_framer_prepend_application_protocol(@NotNull nw_framer_t framer, @NotNull nw_protocol_options_t protocol_options)[@function] nw_framer_prepend_application_protocol Dynamically add a protocol to a connection establishment attempt "above" the framer protocol.static @NotNull nw_protocol_metadata_tnw_framer_protocol_create_message(@NotNull nw_protocol_definition_t definition)[@function] nw_framer_protocol_create_message Create an instance of a framer message on which per- message options can be configured when sending data on a connection.static voidnw_framer_schedule_wakeup(@NotNull nw_framer_t framer, long milliseconds)[@function] nw_framer_schedule_wakeup Schedule a wakeup on the framer instance for a number of milliseconds into the future.static voidnw_framer_set_cleanup_handler(@NotNull nw_framer_t framer, @NotNull Network.Block_nw_framer_set_cleanup_handler cleanup_handler)[@function] nw_framer_set_cleanup_handler Set a handler block to be invoked when the protocol stack is being torn down and deallocated.static voidnw_framer_set_input_handler(@NotNull nw_framer_t framer, @NotNull Network.Block_nw_framer_set_input_handler input_handler)[@function] nw_framer_set_input_handler Set a handler block to be invoked whenever new input data is available to be parsed.static voidnw_framer_set_output_handler(@NotNull nw_framer_t framer, @NotNull Network.Block_nw_framer_set_output_handler output_handler)[@function] nw_framer_set_output_handler Set a handler block to be invoked whenever an output message is ready to be sent.static voidnw_framer_set_stop_handler(@NotNull nw_framer_t framer, @NotNull Network.Block_nw_framer_set_stop_handler stop_handler)[@function] nw_framer_set_stop_handler Set a handler block to be invoked when the connection is being disconnected, to allow the framer implementation a chance to send any final data.static voidnw_framer_set_wakeup_handler(@NotNull nw_framer_t framer, @NotNull Network.Block_nw_framer_set_wakeup_handler wakeup_handler)[@function] nw_framer_set_wakeup_handler Set a handler block to be invoked whenever the wakeup timer set via nw_framer_schedule_wakeup() fires.static voidnw_framer_write_output(@NotNull nw_framer_t framer, @NotNull java.lang.String output_buffer, long output_length)[@function] nw_framer_write_output Write arbitrary bytes as part of an outbound message.static voidnw_framer_write_output_data(@NotNull nw_framer_t framer, @NotNull dispatch_data_t output_data)[@function] nw_framer_write_output_data Write arbitrary bytes as part of an outbound message.static booleannw_framer_write_output_no_copy(@NotNull nw_framer_t framer, long output_length)[@function] nw_framer_write_output_no_copy Write bytes directly from the application without any transformation or copy.static booleannw_group_descriptor_add_endpoint(@NotNull nw_group_descriptor_t descriptor, @NotNull nw_endpoint_t endpoint)[@function] nw_group_descriptor_add_endpoint Add an additional endpoint to a given group descriptor.static @NotNull nw_group_descriptor_tnw_group_descriptor_create_multicast(@NotNull nw_endpoint_t multicast_group)[@function] nw_group_descriptor_create_multicast Creates a new group descriptor object based on a multicast group, represented as an address endpoint.static @NotNull nw_group_descriptor_tnw_group_descriptor_create_multiplex(@NotNull nw_endpoint_t remote_endpoint)[@function] nw_group_descriptor_create_multiplex Creates a new group descriptor object based on an endpoint to which communication will be established using a multiplexing protocol, represented as an nw_endpoint containing the remote endpoint to use for communication.static voidnw_group_descriptor_enumerate_endpoints(@NotNull nw_group_descriptor_t descriptor, @NotNull Network.Block_nw_group_descriptor_enumerate_endpoints enumerate_block)[@function] nw_group_descriptor_enumerate_endpoints List all endpoints associated with the group descriptor.static intnw_interface_get_index(@NotNull nw_interface_t interface_)[@function] nw_interface_get_index Retrieves the index of an interface, to be used for reference or logging purposes.static @NotNull java.lang.Stringnw_interface_get_name(@NotNull nw_interface_t interface_)[@function] nw_interface_get_name Retrieves the name of an interface, to be used for reference or logging purposes.static intnw_interface_get_type(@NotNull nw_interface_t interface_)[@function] nw_interface_get_type Retrieves the type of an interface.static @NotNull nw_protocol_metadata_tnw_ip_create_metadata()[@function] nw_ip_create_metadata Create an instance of IP metadata that can be used to configure per-packet options when sending data on a connection.static intnw_ip_metadata_get_ecn_flag(@NotNull nw_protocol_metadata_t metadata)[@function] nw_ip_metadata_get_ecn_flag Gets ECN flags from IP metadata.static longnw_ip_metadata_get_receive_time(@NotNull nw_protocol_metadata_t metadata)[@function] nw_ip_metadata_get_receive_time Access the time at which a packet was received.static intnw_ip_metadata_get_service_class(@NotNull nw_protocol_metadata_t metadata)[@function] nw_ip_metadata_get_service_class Gets service class from IP metadata.static voidnw_ip_metadata_set_ecn_flag(@NotNull nw_protocol_metadata_t metadata, int ecn_flag)[@function] nw_ip_metadata_set_ecn_flag Sets ECN flags on IP metadata.static voidnw_ip_metadata_set_service_class(@NotNull nw_protocol_metadata_t metadata, int service_class)[@function] nw_ip_metadata_set_service_class Sets service class on IP metadata.static voidnw_ip_options_set_calculate_receive_time(@NotNull nw_protocol_options_t options, boolean calculate_receive_time)[@function] nw_ip_options_set_calculate_receive_time Configure IP to calculate receive time for inbound packets.static voidnw_ip_options_set_disable_fragmentation(@NotNull nw_protocol_options_t options, boolean disable_fragmentation)[@function] nw_ip_options_set_disable_fragmentation Configure IP to disable fragmentation on outgoing packets.static voidnw_ip_options_set_disable_multicast_loopback(@NotNull nw_protocol_options_t options, boolean disable_multicast_loopback)[@function] nw_ip_options_set_disable_multicast_loopback If a multicast packet is sent to a group to which the sending host itself belongs (on the outgoing interface), a copy of the datagram is, by default, looped back by the IP layer for local delivery.static voidnw_ip_options_set_hop_limit(@NotNull nw_protocol_options_t options, byte hop_limit)[@function] nw_ip_options_set_hop_limit Configure the IP hop limit (or 'TTL' for IPv4).static voidnw_ip_options_set_local_address_preference(@NotNull nw_protocol_options_t options, int preference)[@function] nw_ip_options_set_local_address_preference Specify a preference for how to select local addresses for outbound connections.static voidnw_ip_options_set_use_minimum_mtu(@NotNull nw_protocol_options_t options, boolean use_minimum_mtu)[@function] nw_ip_options_set_use_minimum_mtu Configure IP to use the minimum MTU value, which is 1280 bytes for IPv6.static voidnw_ip_options_set_version(@NotNull nw_protocol_options_t options, int version)[@function] nw_ip_options_set_version Specify a single version of the Internet Protocol to allow.static voidnw_listener_cancel(@NotNull nw_listener_t listener)[@function] nw_listener_cancel Cancel the listener.static @Nullable nw_listener_tnw_listener_create(@NotNull nw_parameters_t parameters)[@function] nw_listener_create Creates a networking listener.static @Nullable nw_listener_tnw_listener_create_with_connection(@NotNull nw_connection_t connection, @NotNull nw_parameters_t parameters)[@function] nw_listener_create_with_connection Creates a networking listener based on an existing multiplexing connection.static @Nullable nw_listener_tnw_listener_create_with_port(@NotNull java.lang.String port, @NotNull nw_parameters_t parameters)[@function] nw_listener_create_with_port Creates a networking listener bound to a specified local port.static intnw_listener_get_new_connection_limit(@NotNull nw_listener_t listener)[@function] nw_listener_get_new_connection_limit Gets the listener new connection limit.static charnw_listener_get_port(@NotNull nw_listener_t listener)[@function] nw_listener_get_port Gets the local port as a number in host byte order.static voidnw_listener_set_advertise_descriptor(@NotNull nw_listener_t listener, @Nullable nw_advertise_descriptor_t advertise_descriptor)[@function] nw_listener_set_advertise_descriptor Describes the bonjour service the listener should register.static voidnw_listener_set_advertised_endpoint_changed_handler(@NotNull nw_listener_t listener, @Nullable Network.Block_nw_listener_set_advertised_endpoint_changed_handler handler)[@function] nw_listener_set_advertised_endpoint_changed_handler Sets the client advertised endpoint changed handler.static voidnw_listener_set_new_connection_group_handler(@NotNull nw_listener_t listener, @Nullable Network.Block_nw_listener_set_new_connection_group_handler handler)[@function] nw_listener_set_new_connection_group_handler Sets a new connection group handler to be called upon receiving an incoming connection that has a multiplexing protocol in its connected protocol stack.static voidnw_listener_set_new_connection_handler(@NotNull nw_listener_t listener, @Nullable Network.Block_nw_listener_set_new_connection_handler handler)[@function] nw_listener_set_new_connection_handler Sets the client new connection handler.static voidnw_listener_set_new_connection_limit(@NotNull nw_listener_t listener, int new_connection_limit)[@function] nw_listener_set_new_connection_limit Sets the listener new connection limit.static voidnw_listener_set_queue(@NotNull nw_listener_t listener, @NotNull dispatch_queue_t queue)[@function] nw_listener_set_queue Sets the client callback queue, on which blocks for events will be scheduled.static voidnw_listener_set_state_changed_handler(@NotNull nw_listener_t listener, @Nullable Network.Block_nw_listener_set_state_changed_handler handler)[@function] nw_listener_set_state_changed_handler Sets the state change handler.static voidnw_listener_start(@NotNull nw_listener_t listener)[@function] nw_listener_start Starts the listener, which will cause the listener to start listening for inbound connections.static booleannw_multicast_group_descriptor_get_disable_unicast_traffic(@NotNull nw_group_descriptor_t multicast_descriptor)[@function] nw_multicast_group_descriptor_get_disable_unicast_traffic Check if receiving unicast traffic has been disabled for a multicast connection group.static voidnw_multicast_group_descriptor_set_disable_unicast_traffic(@NotNull nw_group_descriptor_t multicast_descriptor, boolean disable_unicast_traffic)[@function] nw_multicast_group_descriptor_set_disable_unicast_traffic Disable receiving unicast traffic for a connection group that is also receiving multicast traffic.static voidnw_multicast_group_descriptor_set_specific_source(@NotNull nw_group_descriptor_t multicast_descriptor, @NotNull nw_endpoint_t source)[@function] nw_multicast_group_descriptor_set_specific_source Require a particular source for this multicast group descriptor.static voidnw_parameters_clear_prohibited_interface_types(@NotNull nw_parameters_t parameters)[@function] nw_parameters_clear_prohibited_interface_types Clear any interface types that had been prohibited.static voidnw_parameters_clear_prohibited_interfaces(@NotNull nw_parameters_t parameters)[@function] nw_parameters_clear_prohibited_interfaces Clear any interfaces that had been prohibited.static @NotNull nw_parameters_tnw_parameters_copy(@NotNull nw_parameters_t parameters)[@function] nw_parameters_copy Creates a deep copy of a parameters object that can be modified.static @NotNull nw_protocol_stack_tnw_parameters_copy_default_protocol_stack(@NotNull nw_parameters_t parameters)[@function] nw_parameters_copy_default_protocol_stack Retrieve the default protocol stack from a parameters object.static @Nullable nw_endpoint_tnw_parameters_copy_local_endpoint(@NotNull nw_parameters_t parameters)[@function] nw_parameters_copy_local_endpoint Extract the local endpoint set on the connection.static @Nullable nw_interface_tnw_parameters_copy_required_interface(@NotNull nw_parameters_t parameters)[@function] nw_parameters_copy_required_interface Access the required network interface set on the parameters.static @NotNull nw_parameters_tnw_parameters_create()[@function] nw_parameters_create Creates a generic parameters object.static @NotNull nw_parameters_tnw_parameters_create_application_service()[@function] nw_parameters_create_application_service Creates default parameters for use with application services.static @NotNull nw_parameters_tnw_parameters_create_quic(@NotNull Network.Block_nw_parameters_create_quic configure_quic)[@function] nw_parameters_create_quic Creates a parameters object that is configured for QUIC.static @NotNull nw_parameters_tnw_parameters_create_secure_tcp(@NotNull Network.Block_nw_parameters_create_secure_tcp_0 configure_tls, @NotNull Network.Block_nw_parameters_create_secure_tcp_1 configure_tcp)[@function] nw_parameters_create_secure_tcp Creates a parameters object that is configured for TLS and TCP.static @NotNull nw_parameters_tnw_parameters_create_secure_udp(@NotNull Network.Block_nw_parameters_create_secure_udp_0 configure_dtls, @NotNull Network.Block_nw_parameters_create_secure_udp_1 configure_udp)[@function] nw_parameters_create_secure_udp Creates a parameters object that is configured for DTLS and UDP.static bytenw_parameters_get_attribution(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_attribution Returns the attribution set on the parameters.static intnw_parameters_get_expired_dns_behavior(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_expired_dns_behavior Check the effective expired DNS behavior of a connection.static booleannw_parameters_get_fast_open_enabled(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_fast_open_enabled Check if the parameters allow the use of fast open for the top level protocol.static booleannw_parameters_get_include_peer_to_peer(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_include_peer_to_peer Check if the parameters allow the inclusion of peer-to-peer interfaces.static booleannw_parameters_get_local_only(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_local_only Indicates whether or not the parameters limit connections to the local link only.static intnw_parameters_get_multipath_service(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_multipath_service Check the multipath service mode configured on the parameters.static booleannw_parameters_get_prefer_no_proxy(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_prefer_no_proxy Indicates whether or not the parameters cause connections to be attempted without proxies, only using proxies if connections cannot otherwise be completed.static booleannw_parameters_get_prohibit_constrained(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_prohibit_constrained Check if the parameters prohibit constrained interfaces.static booleannw_parameters_get_prohibit_expensive(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_prohibit_expensive Check if the parameters prohibit expensive interfaces.static intnw_parameters_get_required_interface_type(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_required_interface_type Access the required network interface type set on the parameters.static booleannw_parameters_get_reuse_local_address(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_reuse_local_address Check if the parameters allow local address reuse.static intnw_parameters_get_service_class(@NotNull nw_parameters_t parameters)[@function] nw_parameters_get_service_class Check the service class configured on the parameters.static voidnw_parameters_iterate_prohibited_interface_types(@NotNull nw_parameters_t parameters, @NotNull Network.Block_nw_parameters_iterate_prohibited_interface_types iterate_block)[@function] nw_parameters_iterate_prohibited_interface_types List all prohibited network interface types.static voidnw_parameters_iterate_prohibited_interfaces(@NotNull nw_parameters_t parameters, @NotNull Network.Block_nw_parameters_iterate_prohibited_interfaces iterate_block)[@function] nw_parameters_iterate_prohibited_interfaces List all prohibited network interfaces.static voidnw_parameters_prohibit_interface(@NotNull nw_parameters_t parameters, @NotNull nw_interface_t interface_)[@function] nw_parameters_prohibit_interface Prohibit any connections or listeners using these parameters from using the provided network interface.static voidnw_parameters_prohibit_interface_type(@NotNull nw_parameters_t parameters, int interface_type)[@function] nw_parameters_prohibit_interface_type Prohibit any connections or listeners using these parameters from using the provided network interface type.static voidnw_parameters_require_interface(@NotNull nw_parameters_t parameters, @Nullable nw_interface_t interface_)[@function] nw_parameters_require_interface Require any connections or listeners using these parameters to use the provided network interface, or none if NULL is passed.static booleannw_parameters_requires_dnssec_validation(@NotNull nw_parameters_t parameters)[@function] nw_parameters_requires_dnssec_validation Check if DNSSEC validation is required.static voidnw_parameters_set_attribution(@NotNull nw_parameters_t parameters, byte attribution)[@function] nw_parameters_set_attribution In order to help differentiate communication with domains requested by the user from those requested by the developer, attribution may be used.static voidnw_parameters_set_expired_dns_behavior(@NotNull nw_parameters_t parameters, int expired_dns_behavior)[@function] nw_parameters_set_expired_dns_behavior Allow or prohibit the use of expired DNS answers during connection establishment.static voidnw_parameters_set_fast_open_enabled(@NotNull nw_parameters_t parameters, boolean fast_open_enabled)[@function] nw_parameters_set_fast_open_enabled Use fast open for an outbound connection, which may be done at any protocol level.static voidnw_parameters_set_include_peer_to_peer(@NotNull nw_parameters_t parameters, boolean include_peer_to_peer)[@function] nw_parameters_set_include_peer_to_peer Allow the inclusion of peer-to-peer interfaces when listening or establishing outbound connections.static voidnw_parameters_set_local_endpoint(@NotNull nw_parameters_t parameters, @Nullable nw_endpoint_t local_endpoint)[@function] nw_parameters_set_local_endpoint Specify a specific endpoint to use as the local endpoint.static voidnw_parameters_set_local_only(@NotNull nw_parameters_t parameters, boolean local_only)[@function] nw_parameters_set_local_only Set to true to limit inbound connections to peers attached to the local link only.static voidnw_parameters_set_multipath_service(@NotNull nw_parameters_t parameters, int multipath_service)[@function] nw_parameters_set_multipath_service Set the multipath service to use for connections.static voidnw_parameters_set_prefer_no_proxy(@NotNull nw_parameters_t parameters, boolean prefer_no_proxy)[@function] nw_parameters_set_prefer_no_proxy Set to true to attempt connections without using proxies, only using any configured proxies if the connections cannot otherwise be completed.static voidnw_parameters_set_privacy_context(@NotNull nw_parameters_t parameters, @NotNull nw_privacy_context_t privacy_context)[@function] nw_parameters_set_privacy_context Set a privacy context on the parameters, which will be associated with connections and listeners.static voidnw_parameters_set_prohibit_constrained(@NotNull nw_parameters_t parameters, boolean prohibit_constrained)[@function] nw_parameters_set_prohibit_constrained Prohibit any connections or listeners using these parameters from using a network interface that is considered constrained by the system.static voidnw_parameters_set_prohibit_expensive(@NotNull nw_parameters_t parameters, boolean prohibit_expensive)[@function] nw_parameters_set_prohibit_expensive Prohibit any connections or listeners using these parameters from using a network interface that is considered expensive by the system.static voidnw_parameters_set_required_interface_type(@NotNull nw_parameters_t parameters, int interface_type)[@function] nw_parameters_set_required_interface_type Require any connections or listeners using these parameters to use the provided network interface type.static voidnw_parameters_set_requires_dnssec_validation(@NotNull nw_parameters_t parameters, boolean requires_dnssec_validation)[@function] nw_parameters_set_requires_dnssec_validation Require to do or not to do DNSSEC validation when resolving the endpoint, before making a connection.static voidnw_parameters_set_reuse_local_address(@NotNull nw_parameters_t parameters, boolean reuse_local_address)[@function] nw_parameters_set_reuse_local_address Allow any connections using these parameters to reuse local addresses already in use by other connections.static voidnw_parameters_set_service_class(@NotNull nw_parameters_t parameters, int service_class)[@function] nw_parameters_set_service_class Set the data service class to use for connections.static @Nullable nw_endpoint_tnw_path_copy_effective_local_endpoint(@NotNull nw_path_t path)[@function] nw_path_copy_effective_local_endpoint Retrieve the local endpoint that is being used, if present.static @Nullable nw_endpoint_tnw_path_copy_effective_remote_endpoint(@NotNull nw_path_t path)[@function] nw_path_copy_effective_remote_endpoint Retrieve the remote endpoint that is being used, if present.static voidnw_path_enumerate_gateways(@NotNull nw_path_t path, @NotNull Network.Block_nw_path_enumerate_gateways enumerate_block)[@function] nw_path_enumerate_gateways List the IP addresses of the routers acting as the gateways for the path.static voidnw_path_enumerate_interfaces(@NotNull nw_path_t path, @NotNull Network.Block_nw_path_enumerate_interfaces enumerate_block)[@function] nw_path_enumerate_interfaces List all interfaces associated with the path.static intnw_path_get_status(@NotNull nw_path_t path)[@function] nw_path_get_status Retrieves the status of a path.static intnw_path_get_unsatisfied_reason(@NotNull nw_path_t path)[@function] nw_path_get_unsatisfied_reason Retrieves a reason the path is not satisfied.static booleannw_path_has_dns(@NotNull nw_path_t path)[@function] nw_path_has_dns Checks if the path has a DNS server configuration set.static booleannw_path_has_ipv4(@NotNull nw_path_t path)[@function] nw_path_has_ipv4 Checks if the path uses a network interface that supports IPv4 connectivity.static booleannw_path_has_ipv6(@NotNull nw_path_t path)[@function] nw_path_has_ipv6 Checks if the path uses a network interface that supports IPv6 connectivity.static booleannw_path_is_constrained(@NotNull nw_path_t path)[@function] nw_path_is_constrained Checks if the path uses any network interfaces that are considered constrained to the user.static booleannw_path_is_equal(@NotNull nw_path_t path, @NotNull nw_path_t other_path)[@function] nw_path_is_equal Compares two network path objects and checks if their content is equal.static booleannw_path_is_expensive(@NotNull nw_path_t path)[@function] nw_path_is_expensive Checks if the path uses any network interfaces that are considered expensive to the user, such as, but not limited to, a cellular network.static voidnw_path_monitor_cancel(@NotNull nw_path_monitor_t monitor)[@function] nw_path_monitor_cancel Cancel the path monitor.static @NotNull nw_path_monitor_tnw_path_monitor_create()[@function] nw_path_monitor_create Create a default path monitor, that will allow the enumeration of all available interfaces on the system.static @NotNull nw_path_monitor_tnw_path_monitor_create_with_type(int required_interface_type)[@function] nw_path_monitor_create_with_type Create a path monitor specific to an interface type, that will allow the enumeration of any interface that matches the type on the system.static voidnw_path_monitor_prohibit_interface_type(@NotNull nw_path_monitor_t monitor, int interface_type)[@function] nw_path_monitor_prohibit_interface_type Prohibit this path monitor from using the provided network interface type.static voidnw_path_monitor_set_cancel_handler(@NotNull nw_path_monitor_t monitor, @NotNull Network.Block_nw_path_monitor_set_cancel_handler cancel_handler)[@function] nw_path_monitor_set_cancel_handler Set a handler to be called on the queue provided to nw_path_monitor_set_queue once cancellation has completed.static voidnw_path_monitor_set_queue(@NotNull nw_path_monitor_t monitor, @NotNull dispatch_queue_t queue)[@function] nw_path_monitor_set_queue Sets the client update queue.static voidnw_path_monitor_set_update_handler(@NotNull nw_path_monitor_t monitor, @NotNull Network.Block_nw_path_monitor_set_update_handler update_handler)[@function] nw_path_monitor_set_update_handler Sets the client update handler.static voidnw_path_monitor_start(@NotNull nw_path_monitor_t monitor)[@function] nw_path_monitor_start Starts the path monitor.static booleannw_path_uses_interface_type(@NotNull nw_path_t path, int interface_type)[@function] nw_path_uses_interface_type Checks if the path uses a network interface with the specified type.static voidnw_privacy_context_add_proxy(@NotNull nw_privacy_context_t privacy_context, @NotNull nw_proxy_config_t proxy_config)[@function] nw_privacy_context_add_proxy Add a proxy configuration to apply to all connections that participate in this context.static voidnw_privacy_context_clear_proxies(@NotNull nw_privacy_context_t privacy_context)[@function] nw_privacy_context_clear_proxies Clear out any proxies added using `nw_privacy_context_add_proxy`.static @NotNull nw_privacy_context_tnw_privacy_context_create(@NotNull java.lang.String description)[@function] nw_privacy_context_create Create a new privacy context.static voidnw_privacy_context_disable_logging(@NotNull nw_privacy_context_t privacy_context)[@function] nw_privacy_context_disable_logging Disable logging for connections and listeners associated with this context.static voidnw_privacy_context_flush_cache(@NotNull nw_privacy_context_t privacy_context)[@function] nw_privacy_context_flush_cache Flush any cached state stored in this privacy context.static voidnw_privacy_context_require_encrypted_name_resolution(@NotNull nw_privacy_context_t privacy_context, boolean require_encrypted_name_resolution, @Nullable nw_resolver_config_t fallback_resolver_config)[@function] nw_privacy_context_require_encrypted_name_resolution Require that any DNS name resolution occurring for connections associated with this context use encrypted transports, such as TLS or HTTPS.static @NotNull nw_protocol_definition_tnw_protocol_copy_ip_definition()[@function] nw_protocol_copy_ip_definition Access the definition of the default system protocol implementation of IP (Internet Protocol).static @NotNull nw_protocol_definition_tnw_protocol_copy_quic_definition()[@function] nw_protocol_copy_quic_definition Access the definition of the default system protocol implementation of QUIC.static @NotNull nw_protocol_definition_tnw_protocol_copy_tcp_definition()[@function] nw_protocol_copy_tcp_definition Access the definition of the default system protocol implementation of TCP (Transmission Control Protocol).static @NotNull nw_protocol_definition_tnw_protocol_copy_tls_definition()[@function] nw_protocol_copy_tls_definition Access the definition of the default system protocol implementation of TLS (Transport Layer Security).static @NotNull nw_protocol_definition_tnw_protocol_copy_udp_definition()[@function] nw_protocol_copy_udp_definition Access the definition of the default system protocol implementation of UDP (User Datagram Protocol).static @NotNull nw_protocol_definition_tnw_protocol_copy_ws_definition()[@function] nw_protocol_copy_ws_definition Access the definition of the default system implementation of the WebSocket protocol.static booleannw_protocol_definition_is_equal(@NotNull nw_protocol_definition_t definition1, @NotNull nw_protocol_definition_t definition2)[@function] nw_protocol_definition_is_equal Compare two protocol definitions to check if they represent the same protocol.static @NotNull nw_protocol_definition_tnw_protocol_metadata_copy_definition(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_copy_definition Retrieve the protocol definition for a given metadata object.static booleannw_protocol_metadata_is_framer_message(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_framer_message Checks if a protocol metadata object is a framer protocol message.static booleannw_protocol_metadata_is_ip(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_ip Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of IP.static booleannw_protocol_metadata_is_quic(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_quic Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of QUIC.static booleannw_protocol_metadata_is_tcp(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_tcp Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of TCP.static booleannw_protocol_metadata_is_tls(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_tls Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of TLS.static booleannw_protocol_metadata_is_udp(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_udp Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of UDP.static booleannw_protocol_metadata_is_ws(@NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_ws Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of WebSocket.static @NotNull nw_protocol_definition_tnw_protocol_options_copy_definition(@NotNull nw_protocol_options_t options)[@function] nw_protocol_options_copy_definition Retrieve the protocol definition for a given options object.static booleannw_protocol_options_is_quic(@NotNull nw_protocol_options_t options)[@function] nw_protocol_options_is_quic Checks whether the given protocol options define a QUIC protocol.static voidnw_protocol_stack_clear_application_protocols(@NotNull nw_protocol_stack_t stack)[@function] nw_protocol_stack_clear_application_protocols Remove all application-layer protocols from a protocol stack.static @Nullable nw_protocol_options_tnw_protocol_stack_copy_internet_protocol(@NotNull nw_protocol_stack_t stack)[@function] nw_protocol_stack_copy_internet_protocol Access the internet-layer protocol used in a protocol stack.static @Nullable nw_protocol_options_tnw_protocol_stack_copy_transport_protocol(@NotNull nw_protocol_stack_t stack)[@function] nw_protocol_stack_copy_transport_protocol Access the transport-layer protocol used in a protocol stack.static voidnw_protocol_stack_iterate_application_protocols(@NotNull nw_protocol_stack_t stack, @NotNull Network.Block_nw_protocol_stack_iterate_application_protocols iterate_block)[@function] nw_protocol_stack_iterate_application_protocols List all application protocols attached to a protocol stack.static voidnw_protocol_stack_prepend_application_protocol(@NotNull nw_protocol_stack_t stack, @NotNull nw_protocol_options_t protocol)[@function] nw_protocol_stack_prepend_application_protocol Prepend an application-layer protocol onto the top of a protocol stack.static voidnw_protocol_stack_set_transport_protocol(@NotNull nw_protocol_stack_t stack, @NotNull nw_protocol_options_t protocol)[@function] nw_protocol_stack_set_transport_protocol Set the transport-layer protocol to use for a protocol stack.static voidnw_proxy_config_add_excluded_domain(@NotNull nw_proxy_config_t config, @NotNull java.lang.String excluded_domain)[@function] nw_proxy_config_add_excluded_domain Adds a domain to define which hosts should not use the proxy.static voidnw_proxy_config_add_match_domain(@NotNull nw_proxy_config_t config, @NotNull java.lang.String match_domain)[@function] nw_proxy_config_add_match_domain Adds a domain to define which hosts should use the proxy.static voidnw_proxy_config_clear_excluded_domains(@NotNull nw_proxy_config_t config)[@function] nw_proxy_config_clear_excluded_domains Clears all excluded domains defined for the proxy.static voidnw_proxy_config_clear_match_domains(@NotNull nw_proxy_config_t config)[@function] nw_proxy_config_clear_match_domains Clears all match domains defined for the proxy.static @NotNull nw_proxy_config_tnw_proxy_config_create_http_connect(@NotNull nw_endpoint_t proxy_endpoint, @Nullable nw_protocol_options_t proxy_tls_options)[@function] nw_proxy_config_create_http_connect Creates a legacy HTTP CONNECT proxy configuration for a proxy server accessible using HTTP/1.1.static @NotNull nw_proxy_config_tnw_proxy_config_create_oblivious_http(@NotNull nw_relay_hop_t relay, @NotNull java.lang.String relay_resource_path, @NotNull java.lang.String gateway_key_config, long gateway_key_config_length)[@function] nw_proxy_config_create_oblivious_http Creates a proxy configuration for an Oblivious HTTP relay and gateway.static @NotNull nw_proxy_config_tnw_proxy_config_create_relay(@NotNull nw_relay_hop_t first_hop, @Nullable nw_relay_hop_t second_hop)[@function] nw_proxy_config_create_relay Creates a proxy configuration with one or two secure relay hops.static @NotNull nw_proxy_config_tnw_proxy_config_create_socksv5(@NotNull nw_endpoint_t proxy_endpoint)[@function] nw_proxy_config_create_socksv5 Creates a SOCKSv5 proxy configuration.static voidnw_proxy_config_enumerate_excluded_domains(@NotNull nw_proxy_config_t config, @NotNull Network.Block_nw_proxy_config_enumerate_excluded_domains enumerator)[@function] nw_proxy_config_enumerate_excluded_domains Enumerate all excluded domains set on the proxy configuration.static voidnw_proxy_config_enumerate_match_domains(@NotNull nw_proxy_config_t config, @NotNull Network.Block_nw_proxy_config_enumerate_match_domains enumerator)[@function] nw_proxy_config_enumerate_match_domains Enumerate all match domains set on the proxy configuration.static booleannw_proxy_config_get_failover_allowed(@NotNull nw_proxy_config_t proxy_config)[@function] nw_proxy_config_get_failover_allowed Check whether or not a proxy configuration allows failover to non-proxied connections.static voidnw_proxy_config_set_failover_allowed(@NotNull nw_proxy_config_t proxy_config, boolean failover_allowed)[@function] nw_proxy_config_set_failover_allowed Set whether or not a proxy configuration allows failover to non-proxied connections.static voidnw_proxy_config_set_username_and_password(@NotNull nw_proxy_config_t proxy_config, @NotNull java.lang.String username, @Nullable java.lang.String password)[@function] nw_proxy_config_set_username_and_password Configures a username and password to use with a proxy configuration.static voidnw_quic_add_tls_application_protocol(@NotNull nw_protocol_options_t options, @NotNull java.lang.String application_protocol)[@function] nw_quic_add_tls_application_protocol Adds an Application-Layer Protocol Negotiation (ALPN) value to present in the TLS handshake.static @NotNull sec_protocol_metadata_tnw_quic_copy_sec_protocol_metadata(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_copy_sec_protocol_metadata Access the sec_protocol_metadata_t for a given QUIC connection metadata instance.static @NotNull sec_protocol_options_tnw_quic_copy_sec_protocol_options(@NotNull nw_protocol_options_t options)[@function] nw_quic_copy_sec_protocol_options Access the sec_protocol_options_t for a given QUIC options instance.static @NotNull nw_protocol_options_tnw_quic_create_options()[@function] nw_quic_create_options Create an instance of QUIC protocol options.static longnw_quic_get_application_error(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_application_error Access the Application Error value received from the peer in a connection close message.static @Nullable java.lang.Stringnw_quic_get_application_error_reason(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_application_error_reason Access the Application Error reason string received from the peer in a connection close message.static intnw_quic_get_idle_timeout(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_idle_timeout Get the idle timeout value for the QUIC connection.static longnw_quic_get_initial_max_data(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_data Get the initial_max_data transport parameter on a QUIC connection.static longnw_quic_get_initial_max_stream_data_bidirectional_local(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_stream_data_bidirectional_local Get the initial_max_stream_data_bidi_local transport parameter on a QUIC connection.static longnw_quic_get_initial_max_stream_data_bidirectional_remote(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_stream_data_bidirectional_remote Get the initial_max_stream_data_bidi_remote transport parameter on a QUIC connection.static longnw_quic_get_initial_max_stream_data_unidirectional(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_stream_data_unidirectional Get the initial_max_stream_data_uni transport parameter on a QUIC connection.static longnw_quic_get_initial_max_streams_bidirectional(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_streams_bidirectional Get the initial value of maximum bidirectional streams that the peer can initiate on a QUIC connection.static longnw_quic_get_initial_max_streams_unidirectional(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_streams_unidirectional Get the initial value of maximum unidirectional streams that the peer can initiate on a QUIC connection.static charnw_quic_get_keepalive_interval(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_keepalive_interval Retrieves the keep-alive interval set on a QUIC connection.static longnw_quic_get_local_max_streams_bidirectional(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_local_max_streams_bidirectional Get the most recent value of the maximum number of bidirectional streams that the peer can create.static longnw_quic_get_local_max_streams_unidirectional(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_local_max_streams_unidirectional Get the most recent value of the maximum number of unidirectional streams that the peer can create.static charnw_quic_get_max_datagram_frame_size(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_max_datagram_frame_size Get the max_datagram_frame_size transport parameter on a QUIC connection.static charnw_quic_get_max_udp_payload_size(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_max_udp_payload_size Get the maximum length of a QUIC packet (UDP payload) that the client is willing to receive on a connection, in bytes.static longnw_quic_get_remote_idle_timeout(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_remote_idle_timeout Access the idle_timeout value in milliseconds received from the peer in the transport parameters.static longnw_quic_get_remote_max_streams_bidirectional(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_remote_max_streams_bidirectional Get the maximum number of bidirectional streams advertised by peer that an application is allowed to create.static longnw_quic_get_remote_max_streams_unidirectional(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_remote_max_streams_unidirectional Get the maximum number of unidirectional streams advertised by peer that an application is allowed to create.static longnw_quic_get_stream_application_error(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_stream_application_error Access the Application Error value received from the peer in a stream close message.static longnw_quic_get_stream_id(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_stream_id Get the QUIC stream ID.static booleannw_quic_get_stream_is_datagram(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_stream_is_datagram Get whether or not the QUIC stream is a QUIC datagram flow.static booleannw_quic_get_stream_is_unidirectional(@NotNull nw_protocol_options_t options)[@function] nw_quic_get_stream_is_unidirectional Returns whether or not a QUIC stream is unidirectional.static bytenw_quic_get_stream_type(@NotNull nw_protocol_metadata_t stream_metadata)[@function] nw_quic_stream_get_type Describes the type of the QUIC stream.static charnw_quic_get_stream_usable_datagram_frame_size(@NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_stream_usable_datagram_frame_size Get the usable size of a datagram frame from a QUIC datagram flow.static voidnw_quic_set_application_error(@NotNull nw_protocol_metadata_t metadata, long application_error, @Nullable java.lang.String reason)[@function] nw_quic_set_application_error Set the Application Error value to send to the peer in a connection close message.static voidnw_quic_set_idle_timeout(@NotNull nw_protocol_options_t options, int idle_timeout)[@function] nw_quic_set_idle_timeout Define an idle timeout value for the QUIC connection.static voidnw_quic_set_initial_max_data(@NotNull nw_protocol_options_t options, long initial_max_data)[@function] nw_quic_set_initial_max_data Set the initial_max_data transport parameter on a QUIC connection.static voidnw_quic_set_initial_max_stream_data_bidirectional_local(@NotNull nw_protocol_options_t options, long initial_max_stream_data_bidirectional_local)[@function] nw_quic_set_initial_max_stream_data_bidirectional_local Set the initial_max_stream_data_bidi_local transport parameter on a QUIC connection.static voidnw_quic_set_initial_max_stream_data_bidirectional_remote(@NotNull nw_protocol_options_t options, long initial_max_stream_data_bidirectional_remote)[@function] nw_quic_set_initial_max_stream_data_bidirectional_remote Set the initial_max_stream_data_bidi_remote transport parameter on a QUIC connection.static voidnw_quic_set_initial_max_stream_data_unidirectional(@NotNull nw_protocol_options_t options, long initial_max_stream_data_unidirectional)[@function] nw_quic_set_initial_max_stream_data_unidirectional Set the initial_max_stream_data_uni transport parameter on a QUIC connection.static voidnw_quic_set_initial_max_streams_bidirectional(@NotNull nw_protocol_options_t options, long initial_max_streams_bidirectional)[@function] nw_quic_set_initial_max_streams_bidirectional Set the initial value of maximum bidirectional streams that the peer can initiate on a QUIC connection.static voidnw_quic_set_initial_max_streams_unidirectional(@NotNull nw_protocol_options_t options, long initial_max_streams_unidirectional)[@function] nw_quic_set_initial_max_streams_unidirectional Set the initial value of maximum unidirectional streams that the peer can initiate on a QUIC connection.static voidnw_quic_set_keepalive_interval(@NotNull nw_protocol_metadata_t metadata, char keepalive_interval)[@function] nw_quic_set_keepalive_interval Changes the keep-alive interval for QUIC.static voidnw_quic_set_local_max_streams_bidirectional(@NotNull nw_protocol_metadata_t metadata, long max_streams_bidirectional)[@function] nw_quic_set_local_max_streams_bidirectional Sets the maximum number of bidirectional streams that the peer can create.static voidnw_quic_set_local_max_streams_unidirectional(@NotNull nw_protocol_metadata_t metadata, long max_streams_unidirectional)[@function] nw_quic_set_local_max_streams_unidirectional Sets the maximum number of unidirectional streams that the peer can create.static voidnw_quic_set_max_datagram_frame_size(@NotNull nw_protocol_options_t options, char max_datagram_frame_size)[@function] nw_quic_set_max_datagram_frame_size Set the max_datagram_frame_size transport parameter on a QUIC connection.static voidnw_quic_set_max_udp_payload_size(@NotNull nw_protocol_options_t options, char max_udp_payload_size)[@function] nw_quic_set_max_udp_payload_size Define the maximum length of a QUIC packet (UDP payload) that the client is willing to receive on a connection, in bytes.static voidnw_quic_set_stream_application_error(@NotNull nw_protocol_metadata_t metadata, long application_error)[@function] nw_quic_set_stream_application_error Set an Application Error value to send to the peer when the stream is closed.static voidnw_quic_set_stream_is_datagram(@NotNull nw_protocol_options_t options, boolean is_datagram)[@function] nw_quic_set_stream_is_datagram Set whether or not the QUIC stream should be a QUIC datagram flow.static voidnw_quic_set_stream_is_unidirectional(@NotNull nw_protocol_options_t options, boolean is_unidirectional)[@function] nw_quic_set_stream_is_unidirectional Set whether or not a QUIC stream should be unidirectional.static voidnw_relay_hop_add_additional_http_header_field(@NotNull nw_relay_hop_t relay_hop, @NotNull java.lang.String field_name, @NotNull java.lang.String field_value)[@function] nw_relay_hop_add_additional_http_header_field Adds additional HTTP headers to send as part of CONNECT requests to the relay.static @NotNull nw_relay_hop_tnw_relay_hop_create(@Nullable nw_endpoint_t http3_relay_endpoint, @Nullable nw_endpoint_t http2_relay_endpoint, @Nullable nw_protocol_options_t relay_tls_options)[@function] nw_relay_hop_create Creates a configuration for a secure relay.static voidnw_release(org.moe.natj.general.ptr.VoidPtr obj)API-Since: 12.0static @NotNull nw_endpoint_tnw_resolution_report_copy_preferred_endpoint(@NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_copy_preferred_endpoint Copy first resolved endpoint attempted, which may be the same as the successful endpoint.static @NotNull nw_endpoint_tnw_resolution_report_copy_successful_endpoint(@NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_copy_successful_endpoint Copy the resolved endpoint that led to a successful connection.static intnw_resolution_report_get_endpoint_count(@NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_endpoint_count Get the number of resolved endpoints discovered by the resolution step.static longnw_resolution_report_get_milliseconds(@NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_milliseconds Get the number of milliseconds spent on this resolution step.static intnw_resolution_report_get_protocol(@NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_protocol Check the protocol used for endpoint resolution.static intnw_resolution_report_get_source(@NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_source Check the source of a resolution, such as query or cache.static voidnw_resolver_config_add_server_address(@NotNull nw_resolver_config_t config, @NotNull nw_endpoint_t server_address)[@function] nw_resolver_config_add_name_server Modifies the resolver configuration by adding a DNS server address as an endpoint.static @NotNull nw_resolver_config_tnw_resolver_config_create_https(@NotNull nw_endpoint_t url_endpoint)[@function] nw_resolver_config_create_https Creates a DNS-over-HTTPS (DoH) resolver configuration.static @NotNull nw_resolver_config_tnw_resolver_config_create_tls(@NotNull nw_endpoint_t server_endpoint)[@function] nw_resolver_config_create_tls Creates a DNS-over-TLS (DoT) resolver configuration.static org.moe.natj.general.ptr.VoidPtrnw_retain(org.moe.natj.general.ptr.VoidPtr obj)API-Since: 12.0static @NotNull nw_protocol_options_tnw_tcp_create_options()[@function] nw_tcp_create_options Create an instance of TCP protocol options.static intnw_tcp_get_available_receive_buffer(@NotNull nw_protocol_metadata_t metadata)[@function] nw_tcp_get_available_receive_buffer Fetch the number of bytes waiting to be read from the receive buffer.static intnw_tcp_get_available_send_buffer(@NotNull nw_protocol_metadata_t metadata)[@function] nw_tcp_get_available_send_buffer Fetch the number of bytes waiting to be acknowledged in the send buffer.static voidnw_tcp_options_set_connection_timeout(@NotNull nw_protocol_options_t options, int connection_timeout)[@function] nw_tcp_options_set_connection_timeout Define a timeout value after which TCP connection establishment will give up.static voidnw_tcp_options_set_disable_ack_stretching(@NotNull nw_protocol_options_t options, boolean disable_ack_stretching)[@function] nw_tcp_options_set_disable_ack_stretching Configure TCP to disable ACK stretching.static voidnw_tcp_options_set_disable_ecn(@NotNull nw_protocol_options_t options, boolean disable_ecn)[@function] nw_tcp_options_set_disable_ecn Configure TCP to disable default Explicit Congestion Notification (ECN) behavior.static voidnw_tcp_options_set_enable_fast_open(@NotNull nw_protocol_options_t options, boolean enable_fast_open)[@function] nw_tcp_options_set_enable_fast_open Configure TCP to enable TCP Fast Open (TFO).static voidnw_tcp_options_set_enable_keepalive(@NotNull nw_protocol_options_t options, boolean enable_keepalive)[@function] nw_tcp_options_set_enable_keepalive Enable sending TCP keepalive probes.static voidnw_tcp_options_set_keepalive_count(@NotNull nw_protocol_options_t options, int keepalive_count)[@function] nw_tcp_options_set_keepalive_count Configure the number of times TCP keepalive probes should be sent without reply before terminating the connection.static voidnw_tcp_options_set_keepalive_idle_time(@NotNull nw_protocol_options_t options, int keepalive_idle_time)[@function] nw_tcp_options_set_keepalive_idle_time Configure the amount of time that a connection must be idle before TCP should start sending keepalive probes.static voidnw_tcp_options_set_keepalive_interval(@NotNull nw_protocol_options_t options, int keepalive_interval)[@function] nw_tcp_options_set_keepalive_interval Configure the amount of time between sending TCP keepalive probes when the peer is not responding.static voidnw_tcp_options_set_maximum_segment_size(@NotNull nw_protocol_options_t options, int maximum_segment_size)[@function] nw_tcp_options_set_maximum_segment_size Directly configure the maximum segment size (MSS) TCP will use.static voidnw_tcp_options_set_multipath_force_version(@NotNull nw_protocol_options_t options, int multipath_force_version)[@function] nw_tcp_options_set_multipath_force_version Configure MPTCP to use a specified MPTCP standard version.static voidnw_tcp_options_set_no_delay(@NotNull nw_protocol_options_t options, boolean no_delay)[@function] nw_tcp_options_set_no_delay Configure TCP to disable Nagle's algorithm, which will delay sending packets to coalesce sending.static voidnw_tcp_options_set_no_options(@NotNull nw_protocol_options_t options, boolean no_options)[@function] nw_tcp_options_set_no_options Disable sending TCP options and extensions.static voidnw_tcp_options_set_no_push(@NotNull nw_protocol_options_t options, boolean no_push)[@function] nw_tcp_options_set_no_push Wait to send TCP data until the connection has finished writing, or else the TCP send buffer is full.static voidnw_tcp_options_set_persist_timeout(@NotNull nw_protocol_options_t options, int persist_timeout)[@function] nw_tcp_options_set_persist_timeout Define a timeout value after which TCP connections in the persist state will terminate.static voidnw_tcp_options_set_retransmit_connection_drop_time(@NotNull nw_protocol_options_t options, int retransmit_connection_drop_time)[@function] nw_tcp_options_set_retransmit_connection_drop_time Define a timeout value after which TCP will drop a connection with unacknowledged retransmissions.static voidnw_tcp_options_set_retransmit_fin_drop(@NotNull nw_protocol_options_t options, boolean retransmit_fin_drop)[@function] nw_tcp_options_set_retransmit_fin_drop Cause TCP to drop connections after not receiving an ACK multiple times after a FIN, currently set at three.static @NotNull sec_protocol_metadata_tnw_tls_copy_sec_protocol_metadata(@NotNull nw_protocol_metadata_t metadata)[@function] nw_tls_copy_sec_protocol_metadata Access the sec_protocol_metadata_t for a given network protocol metadata instance.static @NotNull sec_protocol_options_tnw_tls_copy_sec_protocol_options(@NotNull nw_protocol_options_t options)[@function] nw_tls_copy_sec_protocol_options Access the sec_protocol_options_t for a given network protocol options instance.static @NotNull nw_protocol_options_tnw_tls_create_options()[@function] nw_tls_create_options Create an instance of TLS protocol options.static booleannw_txt_record_access_bytes(@NotNull nw_txt_record_t txt_record, @NotNull Network.Block_nw_txt_record_access_bytes access_bytes)[@function] nw_txt_record_access_bytes Access the raw TXT record inside the TXT record object.static booleannw_txt_record_access_key(@NotNull nw_txt_record_t txt_record, @NotNull java.lang.String key, @NotNull Network.Block_nw_txt_record_access_key access_value)[@function] nw_txt_record_access_key Access a value in the TXT record object with its key.static booleannw_txt_record_apply(@NotNull nw_txt_record_t txt_record, @NotNull Network.Block_nw_txt_record_apply applier)[@function] nw_txt_record_apply Apply the block to every key-value pair in the TXT record object.static @Nullable nw_txt_record_tnw_txt_record_copy(@Nullable nw_txt_record_t txt_record)[@function] nw_txt_record_copy Create a deep copy of an existing TXT record object.static @NotNull nw_txt_record_tnw_txt_record_create_dictionary()[@function] nw_txt_record_create_dictionary Create an empty TXT record dictionary.static @NotNull nw_txt_record_tnw_txt_record_create_with_bytes(@NotNull java.lang.String txt_bytes, long txt_len)[@function] nw_txt_record_create_with_bytes Create a new TXT record object from a buffer of bytes.static intnw_txt_record_find_key(@NotNull nw_txt_record_t txt_record, @NotNull java.lang.String key)[@function] nw_txt_record_find_key Find a key-value pair in the TXT record object.static longnw_txt_record_get_key_count(@Nullable nw_txt_record_t txt_record)[@function] nw_txt_record_get_key_count Count the number of keys in the TXT record object.static booleannw_txt_record_is_dictionary(@NotNull nw_txt_record_t txt_record)[@function] nw_txt_record_is_dictionary Check whether the TXT record is a dictionary or a buffer.static booleannw_txt_record_is_equal(@Nullable nw_txt_record_t left, @Nullable nw_txt_record_t right)[@function] nw_txt_record_is_equal Check if the two TXT record objects are equal.static booleannw_txt_record_remove_key(@NotNull nw_txt_record_t txt_record, @NotNull java.lang.String key)[@function] nw_txt_record_remove_key Removes a key-value pair in the TXT record object given its key.static booleannw_txt_record_set_key(@NotNull nw_txt_record_t txt_record, @NotNull java.lang.String key, @Nullable java.lang.String value, long value_len)[@function] nw_txt_record_set_key Set a key-value pair on the TXT record object.static @NotNull nw_protocol_metadata_tnw_udp_create_metadata()[@function] nw_udp_create_metadata Create an instance of UDP metadata that can be used to configure per-datagram options when sending data on a connection.static @NotNull nw_protocol_options_tnw_udp_create_options()[@function] nw_udp_create_options Create an instance of UDP protocol options.static voidnw_udp_options_set_prefer_no_checksum(@NotNull nw_protocol_options_t options, boolean prefer_no_checksum)[@function] nw_udp_options_set_prefer_no_checksum Configure UDP to skip computing checksums when sending.static @NotNull nw_protocol_metadata_tnw_ws_create_metadata(int opcode)[@function] nw_ws_create_metadata Creates a protocol metadata object that can be used to define the content context of messages sent over a WebSocket connection.static @NotNull nw_protocol_options_tnw_ws_create_options(int version)[@function] nw_ws_create_options Create an instance of WebSocket protocol options.static @NotNull nw_ws_response_tnw_ws_metadata_copy_server_response(@NotNull nw_protocol_metadata_t metadata)[@function] nw_ws_metadata_copy_server_response Copy the WebSocket server's response to a client's request to connect.static intnw_ws_metadata_get_close_code(@NotNull nw_protocol_metadata_t metadata)[@function] nw_ws_metadata_get_close_code Get the close code from a WebSocket frame.static intnw_ws_metadata_get_opcode(@NotNull nw_protocol_metadata_t metadata)[@function] nw_ws_metadata_get_opcode Get the opcode on a WebSocket frame.static voidnw_ws_metadata_set_close_code(@NotNull nw_protocol_metadata_t metadata, int close_code)[@function] nw_ws_metadata_set_close_code Set the close code on a WebSocket frame.static voidnw_ws_metadata_set_pong_handler(@NotNull nw_protocol_metadata_t metadata, @NotNull dispatch_queue_t client_queue, @NotNull Network.Block_nw_ws_metadata_set_pong_handler pong_handler)[@function] nw_ws_metadata_set_pong_handler Set a callback that will notify the client when a pong message has been received for a ping message sent.static voidnw_ws_options_add_additional_header(@NotNull nw_protocol_options_t options, @NotNull java.lang.String name, @NotNull java.lang.String value)[@function] nw_ws_options_add_additional_header Set additional HTTP headers to be sent by the client during the WebSocket handshake.static voidnw_ws_options_add_subprotocol(@NotNull nw_protocol_options_t options, @NotNull java.lang.String subprotocol)[@function] nw_ws_options_add_subprotocol Add to the list of subprotocols that will be presented to a WebSocket server during connection establishment.static voidnw_ws_options_set_auto_reply_ping(@NotNull nw_protocol_options_t options, boolean auto_reply_ping)[@function] nw_ws_options_set_auto_reply_ping Set whether the WebSocket connection should automatically reply to all incoming pings.static voidnw_ws_options_set_client_request_handler(@NotNull nw_protocol_options_t options, @NotNull dispatch_queue_t client_queue, @NotNull Network.Block_nw_ws_options_set_client_request_handler handler)[@typedef] nw_ws_options_set_client_request_handler Set callback handler to be invoked when a WebSocket server receives a WebSocket client's request to connect.static voidnw_ws_options_set_maximum_message_size(@NotNull nw_protocol_options_t options, long maximum_message_size)[@function] nw_ws_options_set_maximum_message_size Set the maximum allowed message size to be received by the WebSocket connection.static voidnw_ws_options_set_skip_handshake(@NotNull nw_protocol_options_t options, boolean skip_handshake)[@function] nw_ws_options_set_skip_handshake Set whether the WebSocket protocol should skip the opening handshake and begin framing data as soon as a connection is established.static booleannw_ws_request_enumerate_additional_headers(@NotNull nw_ws_request_t request, @NotNull Network.Block_nw_ws_request_enumerate_additional_headers enumerator)[@function] nw_ws_request_enumerate_additional_headers Enumerates the list of additional headers on the client's request.static booleannw_ws_request_enumerate_subprotocols(@NotNull nw_ws_request_t request, @NotNull Network.Block_nw_ws_request_enumerate_subprotocols enumerator)[@function] nw_ws_request_enumerate_subprotocols Enumerates the list of subprotocols on the client's request.static voidnw_ws_response_add_additional_header(@NotNull nw_ws_response_t response, @NotNull java.lang.String name, @NotNull java.lang.String value)[@function] nw_ws_response_add_additional_header Add additional HTTP headers to be sent back to the WebSocket client in the server's response.static @NotNull nw_ws_response_tnw_ws_response_create(int status, @Nullable java.lang.String selected_subprotocol)[@function] nw_ws_response_create Create a server response to a WebSocket client's opening handshake.static booleannw_ws_response_enumerate_additional_headers(@NotNull nw_ws_response_t response, @NotNull Network.Block_nw_ws_response_enumerate_additional_headers enumerator)[@function] nw_ws_response_enumerate_additional_headers Enumerates the list of additional headers on the server's response.static @Nullable java.lang.Stringnw_ws_response_get_selected_subprotocol(@NotNull nw_ws_response_t response)[@function] nw_ws_response_get_selected_subprotocol Get the selected subprotocol from a WebSocket server's response.static intnw_ws_response_get_status(@Nullable nw_ws_response_t response)[@function] nw_ws_response_get_status Get the status from a WebSocket server's response.
-
-
-
Field Detail
-
NW_NOT_i386_MAC
public static final double NW_NOT_i386_MAC
- See Also:
- Constant Field Values
-
NW_FRAMER_CREATE_FLAGS_DEFAULT
public static final double NW_FRAMER_CREATE_FLAGS_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
nw_txt_record_create_with_bytes
@NotNull public static @NotNull nw_txt_record_t nw_txt_record_create_with_bytes(@NotNull @NotNull java.lang.String txt_bytes, long txt_len)
[@function] nw_txt_record_create_with_bytes Create a new TXT record object from a buffer of bytes. If the buffer follows the key-value pair format as defined in RFC 1464, the TXT record object will be created as a dictionary. Otherwise, it is created as a TXT record buffer.- Parameters:
txt_bytes- The pointer to the buffer.txt_len- The length of the buffer.- Returns:
- An instantiated TXT record object. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails if txt_bytes is NULL or if txt_len is 0. API-Since: 13.0
-
nw_txt_record_create_dictionary
@NotNull public static @NotNull nw_txt_record_t nw_txt_record_create_dictionary()
[@function] nw_txt_record_create_dictionary Create an empty TXT record dictionary.- Returns:
- An empty TXT record dictionary. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. API-Since: 13.0
-
nw_txt_record_copy
@Nullable public static @Nullable nw_txt_record_t nw_txt_record_copy(@Nullable @Nullable nw_txt_record_t txt_record)
[@function] nw_txt_record_copy Create a deep copy of an existing TXT record object.- Parameters:
txt_record- The TXT record object to be copied.- Returns:
- A deep copy of the TXT record object. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. API-Since: 13.0
-
nw_txt_record_find_key
public static int nw_txt_record_find_key(@NotNull @NotNull nw_txt_record_t txt_record, @NotNull @NotNull java.lang.String key)[@function] nw_txt_record_find_key Find a key-value pair in the TXT record object.- Parameters:
txt_record- The TXT record object.key- The key of the key-value pair.- Returns:
- An nw_txt_record_find_key_t representing the type of the key-value pair found. The key may be invalid, may not exist, have no associated value, have an empty associated value, or have a non-empty associated value. API-Since: 13.0
-
nw_txt_record_access_key
public static boolean nw_txt_record_access_key(@NotNull @NotNull nw_txt_record_t txt_record, @NotNull @NotNull java.lang.String key, @NotNull @NotNull Network.Block_nw_txt_record_access_key access_value)[@function] nw_txt_record_access_key Access a value in the TXT record object with its key. Attempts to access or modify the TXT record object from within the block are prohibited.- Parameters:
txt_record- The TXT record object.access_value- The block that will be used to access the value of the given key.- Returns:
- The return value of the access_value block. This is an arbitrary return value defined by the user. API-Since: 13.0
-
nw_txt_record_set_key
public static boolean nw_txt_record_set_key(@NotNull @NotNull nw_txt_record_t txt_record, @NotNull @NotNull java.lang.String key, @Nullable @Nullable java.lang.String value, long value_len)[@function] nw_txt_record_set_key Set a key-value pair on the TXT record object.- Parameters:
txt_record- The TXT record object.key- The key that will be inserted. If the key already exists in the TXT record object, the existing key-value pair will be replaced.value- The value that will be inserted. If value is set to NULL, then the key will be inserted with no value.value_len- The length of the value will be inserted. If value is set to zero, then the key will be inserted with a zero-length value. Inserting a NULL value with a non-zero length will fail.- Returns:
- A boolean indicating if the key-value pair was inserted successfully. Returns false if the key is invalid. A key is invalid if it is an empty string, contains non-ASCII characters, or has length greater than UINT8_MAX. API-Since: 13.0
-
nw_txt_record_remove_key
public static boolean nw_txt_record_remove_key(@NotNull @NotNull nw_txt_record_t txt_record, @NotNull @NotNull java.lang.String key)[@function] nw_txt_record_remove_key Removes a key-value pair in the TXT record object given its key.- Parameters:
txt_record- The TXT record object.key- The key corresponding to the key-value pair.- Returns:
- A boolean indicating if the key-value pair specified by the given key was removed. Returns false if the key is invalid or not present in the TXT dictionary. A key is invalid if it is an empty string, contains non-ASCII characters, or has length greater than UINT8_MAX. API-Since: 13.0
-
nw_txt_record_get_key_count
public static long nw_txt_record_get_key_count(@Nullable @Nullable nw_txt_record_t txt_record)[@function] nw_txt_record_get_key_count Count the number of keys in the TXT record object.- Parameters:
txt_record- A TXT record object.- Returns:
- The number of keys in the TXT record object. API-Since: 13.0
-
nw_txt_record_access_bytes
public static boolean nw_txt_record_access_bytes(@NotNull @NotNull nw_txt_record_t txt_record, @NotNull @NotNull Network.Block_nw_txt_record_access_bytes access_bytes)[@function] nw_txt_record_access_bytes Access the raw TXT record inside the TXT record object.- Parameters:
txt_record- The TXT record object.access_bytes- The block that will be used to access the raw TXT record inside the TXT record object.- Returns:
- The return value of the access_bytes block, which is defined by the user. For example, the user may want to return a boolean indicating if the operation succeeds. API-Since: 13.0
-
nw_txt_record_apply
public static boolean nw_txt_record_apply(@NotNull @NotNull nw_txt_record_t txt_record, @NotNull @NotNull Network.Block_nw_txt_record_apply applier)[@function] nw_txt_record_apply Apply the block to every key-value pair in the TXT record object.- Parameters:
txt_record- The TXT record object.applier- The block that will be applied to the entire TXT record object.- Returns:
- A boolean indicating whether iteration of the TXT record object completed successfully. Iteration will only fail if the applier block returns false. API-Since: 13.0
-
nw_txt_record_is_equal
public static boolean nw_txt_record_is_equal(@Nullable @Nullable nw_txt_record_t left, @Nullable @Nullable nw_txt_record_t right)[@function] nw_txt_record_is_equal Check if the two TXT record objects are equal.- Parameters:
left- The first TXT record object to be compared.right- The second TXT record object to be compared.- Returns:
- A boolean indicating if the two TXT record objects are equal. Two TXT record objects are equal if they contain the same set of key-value pairs, where keys are compared case-insensitively. For example, "ABC=1" and "abc=1" are identical key-value pairs. The ordering of the key-value pairs does not matter. API-Since: 13.0
-
nw_txt_record_is_dictionary
public static boolean nw_txt_record_is_dictionary(@NotNull @NotNull nw_txt_record_t txt_record)[@function] nw_txt_record_is_dictionary Check whether the TXT record is a dictionary or a buffer.- Parameters:
txt_record- The TXT record object.- Returns:
- A boolean indicating whether the TXT record is a dictionary or a buffer. If true, the TXT record is a dictionary. If false, the TXT record is a buffer. API-Since: 13.0
-
nw_advertise_descriptor_create_bonjour_service
@Nullable public static @Nullable nw_advertise_descriptor_t nw_advertise_descriptor_create_bonjour_service(@Nullable @Nullable java.lang.String name, @NotNull @NotNull java.lang.String type, @Nullable @Nullable java.lang.String domain)
[@function] nw_advertise_descriptor_create_bonjour_service Creates a new advertise descriptor object based on a Bonjour service type and optional domain. This object can be used with listener objects to specify the service the listener should advertise. If the name is unspecified, the default name for the device will be used. If the domain is unspecified, the default domains for registration will be used. If the listener is local only, the domain 'local.' will be used regardless of the parameter passed to domain.- Parameters:
name- An optional Bonjour service name.type- A Bonjour service type.domain- An optional Bonjour service domain.- Returns:
- An instantiated browse descriptor object. API-Since: 12.0
-
nw_advertise_descriptor_set_txt_record
public static void nw_advertise_descriptor_set_txt_record(@NotNull @NotNull nw_advertise_descriptor_t advertise_descriptor, @Nullable @Nullable org.moe.natj.general.ptr.ConstVoidPtr txt_record, long txt_length)[@function] nw_advertise_descriptor_set_txt_record Set the TXT record for the advertise descriptor's service. You must call nw_listener_set_advertise_descriptor to update the listener's advertising afterwards in order for these changes to take effect.- Parameters:
advertise_descriptor- The advertise descriptor to modify.txt_record- A pointer to the TXT record.txt_length- The length of the TXT record. The total size of a typical DNS-SD TXT record is intended to be small - 200 bytes or less. Using TXT records larger than 1300 bytes is not recommended at this time. API-Since: 12.0
-
nw_advertise_descriptor_set_no_auto_rename
public static void nw_advertise_descriptor_set_no_auto_rename(@NotNull @NotNull nw_advertise_descriptor_t advertise_descriptor, boolean no_auto_rename)[@function] nw_advertise_descriptor_set_no_auto_rename Disable auto-rename for the Bonjour service registration. Auto-rename is enabled by default.- Parameters:
advertise_descriptor- The advertise descriptor to modify.no_auto_rename- A boolean indicating if auto-rename should be disabled. API-Since: 12.0
-
nw_advertise_descriptor_get_no_auto_rename
public static boolean nw_advertise_descriptor_get_no_auto_rename(@NotNull @NotNull nw_advertise_descriptor_t advertise_descriptor)[@function] nw_advertise_descriptor_get_no_auto_rename Check if auto-rename has been disabled for the Bonjour service registration.- Parameters:
advertise_descriptor- The advertise descriptor object.- Returns:
- A boolean indicating if auto-rename is disabled. API-Since: 12.0
-
nw_advertise_descriptor_set_txt_record_object
public static void nw_advertise_descriptor_set_txt_record_object(@NotNull @NotNull nw_advertise_descriptor_t advertise_descriptor, @Nullable @Nullable nw_txt_record_t txt_record)[@function] nw_advertise_descriptor_set_txt_record_object Set the TXT record object on the advertise descriptor.- Parameters:
advertise_descriptor- The advertise descriptor object.txt_record- The TXT record object. If txt_record is NULL, the advertise_descriptor's current TXT record object will be removed. API-Since: 13.0
-
nw_advertise_descriptor_copy_txt_record_object
@Nullable public static @Nullable nw_txt_record_t nw_advertise_descriptor_copy_txt_record_object(@NotNull @NotNull nw_advertise_descriptor_t advertise_descriptor)
[@function] nw_advertise_descriptor_copy_txt_record_object Copies the TXT record object from the advertise descriptor.- Parameters:
advertise_descriptor- The advertise descriptor object.- Returns:
- A copy of the TXT record object, or NULL if the advertise descriptor does not have an associated TXT record. API-Since: 13.0
-
nw_protocol_definition_is_equal
public static boolean nw_protocol_definition_is_equal(@NotNull @NotNull nw_protocol_definition_t definition1, @NotNull @NotNull nw_protocol_definition_t definition2)[@function] nw_protocol_definition_is_equal Compare two protocol definitions to check if they represent the same protocol.- Parameters:
definition1- The first definition to comparedefinition2- The second definition to compare- Returns:
- Returns true if the definitions represent the same protocol, false otherwise. API-Since: 12.0
-
nw_protocol_options_copy_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_options_copy_definition(@NotNull @NotNull nw_protocol_options_t options)
[@function] nw_protocol_options_copy_definition Retrieve the protocol definition for a given options object.- Parameters:
options- The protocol options to check- Returns:
- Returns a reference-counted protocol definition object. API-Since: 12.0
-
nw_protocol_metadata_copy_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_metadata_copy_definition(@NotNull @NotNull nw_protocol_metadata_t metadata)
[@function] nw_protocol_metadata_copy_definition Retrieve the protocol definition for a given metadata object.- Parameters:
metadata- The protocol metadata to check- Returns:
- Returns a reference-counted protocol definition object. API-Since: 12.0
-
nw_interface_get_type
public static int nw_interface_get_type(@NotNull @NotNull nw_interface_t interface_)[@function] nw_interface_get_type Retrieves the type of an interface. This only accesses the type of the specific interface being queried, and will not take into account types used by interfaces that traffic will eventually be routed through. That is, if the interface is a virtual interface (such as a VPN) that eventually forwards traffic through Wi-Fi, the type will be nw_interface_type_other, not nw_interface_type_wifi.- Parameters:
interface- The interface object to check.- Returns:
- Returns the type of the interface. API-Since: 12.0
-
nw_interface_get_name
@NotNull public static @NotNull java.lang.String nw_interface_get_name(@NotNull @NotNull nw_interface_t interface_)[@function] nw_interface_get_name Retrieves the name of an interface, to be used for reference or logging purposes.- Parameters:
interface- The interface object to check.- Returns:
- Returns the name of the interface as a NULL-terminated C string, or NULL if the interface is NULL. API-Since: 12.0
-
nw_interface_get_index
public static int nw_interface_get_index(@NotNull @NotNull nw_interface_t interface_)[@function] nw_interface_get_index Retrieves the index of an interface, to be used for reference or logging purposes. This is the same value as provided by if_nametoindex.- Parameters:
interface- The interface object to check.- Returns:
- Returns the index of the interface, or 0 if the interface is NULL. API-Since: 12.0
-
nw_endpoint_get_type
public static int nw_endpoint_get_type(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_type Retrieves the type of a network endpoint.- Parameters:
endpoint- The endpoint object for which to get the type.- Returns:
- Returns the type of the network endpoint. API-Since: 12.0
-
nw_endpoint_create_host
@NotNull public static @NotNull nw_endpoint_t nw_endpoint_create_host(@NotNull @NotNull java.lang.String hostname, @NotNull @NotNull java.lang.String port)
[@function] nw_endpoint_create_host Creates a network endpoint with a hostname and port. The hostname may be a string-encoding of an IP address, in which case the the endpoint will be treated as an endpoint with the type nw_endpoint_type_address. Otherwise, the endpoint will have the type nw_endpoint_type_host.- Parameters:
hostname- A hostname, such as "www.example.com", or "2607:ffff::1234:abcd".port- A port number as a C string, such as "443", or a service name, such as "https".- Returns:
- Returns an allocated nw_endpoint_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_endpoint_get_hostname
@NotNull public static @NotNull java.lang.String nw_endpoint_get_hostname(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_hostname Retrieves the hostname string for a network endpoint with the type nw_endpoint_type_host or nw_endpoint_type_url.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the hostname string for the endpoint, or NULL if the endpoint is not of type nw_endpoint_type_host. API-Since: 12.0
-
nw_endpoint_copy_port_string
@NotNull public static @NotNull org.moe.natj.general.ptr.BytePtr nw_endpoint_copy_port_string(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_copy_port_string Returns an allocated port string for a network endpoint with the type nw_endpoint_type_host or nw_endpoint_type_address.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the port string for the endpoint, or NULL if the endpoint is not of type nw_endpoint_type_host or nw_endpoint_type_address. This string must be freed with free(). API-Since: 12.0
-
nw_endpoint_get_port
public static char nw_endpoint_get_port(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_port Retrieves the port for a network endpoint with the type nw_endpoint_type_url, nw_endpoint_type_host, or nw_endpoint_type_address. The port will be returned in Host Byte Order.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the port for the endpoint, or 0 if the endpoint is not of type nw_endpoint_type_host or nw_endpoint_type_address. The port will be returned in Host Byte Order. API-Since: 12.0
-
nw_endpoint_create_address
@NotNull public static @NotNull nw_endpoint_t nw_endpoint_create_address(@NotNull @NotNull sockaddr address)
[@function] nw_endpoint_create_address Creates a network endpoint with a sockaddr struct. The endpoint will have the type nw_endpoint_type_address.- Parameters:
address- An address stored as a sockaddr.- Returns:
- Returns an allocated nw_endpoint_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_endpoint_copy_address_string
@NotNull public static @NotNull org.moe.natj.general.ptr.BytePtr nw_endpoint_copy_address_string(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_copy_address_string Returns an allocated IP address string for a network endpoint with the type nw_endpoint_type_address.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the IP address string for the endpoint, or NULL if the endpoint is not of type nw_endpoint_type_address. This string must be freed with free(). API-Since: 12.0
-
nw_endpoint_get_address
@NotNull public static @NotNull sockaddr nw_endpoint_get_address(@NotNull @NotNull nw_endpoint_t endpoint)
[@function] nw_endpoint_get_address Retrieves the sockaddr struct for a network endpoint with the type nw_endpoint_type_address.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the sockaddr struct for the endpoint, or NULL if the endpoint is not of type nw_endpoint_type_address. API-Since: 12.0
-
nw_endpoint_create_bonjour_service
@NotNull public static @NotNull nw_endpoint_t nw_endpoint_create_bonjour_service(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String type, @NotNull @NotNull java.lang.String domain)
[@function] nw_endpoint_create_bonjour_service Creates a network endpoint for a Bonjour Service name, type, and domain. The endpoint will have the type nw_endpoint_type_bonjour_service.- Parameters:
name- The Bonjour Service name, such as "example".type- The Bonjour Service type, such as "_http._tcp".domain- The Bonjour Service domain, such as "local".- Returns:
- Returns an allocated nw_endpoint_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_endpoint_get_bonjour_service_name
@NotNull public static @NotNull java.lang.String nw_endpoint_get_bonjour_service_name(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_bonjour_service_name Retrieves the Bonjour Service name string for a network endpoint with the type nw_endpoint_type_bonjour_service.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the Bonjour Service name string for the endpoint, or NULL if the endpoint is not of type nw_endpoint_type_bonjour_service. API-Since: 12.0
-
nw_endpoint_get_bonjour_service_type
@NotNull public static @NotNull java.lang.String nw_endpoint_get_bonjour_service_type(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_bonjour_service_type Retrieves the Bonjour Service type string for a network endpoint with the type nw_endpoint_type_bonjour_service.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the Bonjour Service type string for the endpoint, or NULL if the endpoint is not of type nw_endpoint_type_bonjour_service. API-Since: 12.0
-
nw_endpoint_get_bonjour_service_domain
@NotNull public static @NotNull java.lang.String nw_endpoint_get_bonjour_service_domain(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_bonjour_service_domain Retrieves the Bonjour Service domain string for a network endpoint with the type nw_endpoint_type_bonjour_service.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns the Bonjour Service domain string for the endpoint, or NULL if the endpoint is not of type nw_endpoint_type_bonjour_service. API-Since: 12.0
-
nw_endpoint_create_url
@NotNull public static @NotNull nw_endpoint_t nw_endpoint_create_url(@NotNull @NotNull java.lang.String url)
[@function] nw_endpoint_create_url Creates a network endpoint with a URL. The endpoint will have the type nw_endpoint_type_url.- Parameters:
url- The URL string.- Returns:
- Returns an allocated nw_endpoint_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters, or due to URL parsing failure. API-Since: 13.0
-
nw_endpoint_get_url
@NotNull public static @NotNull java.lang.String nw_endpoint_get_url(@NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_endpoint_get_url Retrieves the URL string from a network endpoint of type nw_endpoint_type_url.- Parameters:
endpoint- The endpoint object.- Returns:
- The URL string, or NULL if the endpoint is not of type nw_endpoint_type_url. API-Since: 13.0
-
nw_parameters_create_secure_tcp
@NotNull public static @NotNull nw_parameters_t nw_parameters_create_secure_tcp(@NotNull @NotNull Network.Block_nw_parameters_create_secure_tcp_0 configure_tls, @NotNull @NotNull Network.Block_nw_parameters_create_secure_tcp_1 configure_tcp)
[@function] nw_parameters_create_secure_tcp Creates a parameters object that is configured for TLS and TCP. The caller can use the default configuration for TLS and TCP, or set specific options for each protocol, or disable TLS.- Parameters:
configure_tls- A block to configure TLS. To use the default TLS configuration, pass NW_PARAMETERS_DEFAULT_CONFIGURATION. To configure specific options, pass a custom block and operate on the nw_protocol_options_t object. To disable TLS, pass NW_PARAMETERS_DISABLE_PROTOCOL.configure_tcp- A block to configure TCP. To use the default TCP configuration, pass NW_PARAMETERS_DEFAULT_CONFIGURATION. To configure specific options, pass a custom block and operate on the nw_protocol_options_t object. It is invalid to try to disable TCP using NW_PARAMETERS_DISABLE_PROTOCOL.- Returns:
- Returns an allocated nw_parameters_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_parameters_create_secure_udp
@NotNull public static @NotNull nw_parameters_t nw_parameters_create_secure_udp(@NotNull @NotNull Network.Block_nw_parameters_create_secure_udp_0 configure_dtls, @NotNull @NotNull Network.Block_nw_parameters_create_secure_udp_1 configure_udp)
[@function] nw_parameters_create_secure_udp Creates a parameters object that is configured for DTLS and UDP. The caller can use the default configuration for DTLS and UDP, or set specific options for each protocol, or disable DTLS.- Parameters:
configure_dtls- A block to configure DTLS. To use the default DTLS configuration, pass NW_PARAMETERS_DEFAULT_CONFIGURATION. To configure specific options, pass a custom block and operate on the nw_protocol_options_t object. To disable DTLS, pass NW_PARAMETERS_DISABLE_PROTOCOL.configure_udp- A block to configure UDP. To use the default UDP configuration, pass NW_PARAMETERS_DEFAULT_CONFIGURATION. To configure specific options, pass a custom block and operate on the nw_protocol_options_t object. It is invalid to try to disable UDP using NW_PARAMETERS_DISABLE_PROTOCOL.- Returns:
- Returns an allocated nw_parameters_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_parameters_create
@NotNull public static @NotNull nw_parameters_t nw_parameters_create()
[@function] nw_parameters_create Creates a generic parameters object. Note that in order to use parameters with an nw_connection_t or an nw_listener_t, the parameters must have protocols added into the default nw_protocol_stack_t. Clients using standard protocol configurations should use nw_parameters_create_secure_tcp() or nw_parameters_create_secure_udp().- Returns:
- Returns an allocated nw_parameters_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. API-Since: 12.0
-
nw_parameters_copy
@NotNull public static @NotNull nw_parameters_t nw_parameters_copy(@NotNull @NotNull nw_parameters_t parameters)
[@function] nw_parameters_copy Creates a deep copy of a parameters object that can be modified.- Parameters:
parameters- The existing parameters object to copy- Returns:
- Returns a newly allocated nw_parameters_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_parameters_require_interface
public static void nw_parameters_require_interface(@NotNull @NotNull nw_parameters_t parameters, @Nullable @Nullable nw_interface_t interface_)[@function] nw_parameters_require_interface Require any connections or listeners using these parameters to use the provided network interface, or none if NULL is passed.- Parameters:
parameters- The parameters object to configureinterface- The interface to require for connections or listeners, or NULL to allow any interface. API-Since: 12.0
-
nw_parameters_copy_required_interface
@Nullable public static @Nullable nw_interface_t nw_parameters_copy_required_interface(@NotNull @NotNull nw_parameters_t parameters)
[@function] nw_parameters_copy_required_interface Access the required network interface set on the parameters.- Parameters:
parameters- The parameters object to check- Returns:
- Returns the interface that is required by the parameters, or NULL if no interface is required. API-Since: 12.0
-
nw_parameters_prohibit_interface
public static void nw_parameters_prohibit_interface(@NotNull @NotNull nw_parameters_t parameters, @NotNull @NotNull nw_interface_t interface_)[@function] nw_parameters_prohibit_interface Prohibit any connections or listeners using these parameters from using the provided network interface.- Parameters:
parameters- The parameters object to configureinterface- The interface to prohibit for connections or listeners. API-Since: 12.0
-
nw_parameters_clear_prohibited_interfaces
public static void nw_parameters_clear_prohibited_interfaces(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_clear_prohibited_interfaces Clear any interfaces that had been prohibited.- Parameters:
parameters- The parameters object to modify API-Since: 12.0
-
nw_parameters_iterate_prohibited_interfaces
public static void nw_parameters_iterate_prohibited_interfaces(@NotNull @NotNull nw_parameters_t parameters, @NotNull @NotNull Network.Block_nw_parameters_iterate_prohibited_interfaces iterate_block)[@function] nw_parameters_iterate_prohibited_interfaces List all prohibited network interfaces.- Parameters:
parameters- The parameters object to checkiterate_block- A block that will return the interfaces prohibited by the parameters. Returning true from the block will continue to iterate, and returning false will stop iterating. API-Since: 12.0
-
nw_parameters_set_required_interface_type
public static void nw_parameters_set_required_interface_type(@NotNull @NotNull nw_parameters_t parameters, int interface_type)[@function] nw_parameters_set_required_interface_type Require any connections or listeners using these parameters to use the provided network interface type.- Parameters:
parameters- The parameters object to configureinterface_type- The interface type to require for connections or listeners. API-Since: 12.0
-
nw_parameters_get_required_interface_type
public static int nw_parameters_get_required_interface_type(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_required_interface_type Access the required network interface type set on the parameters.- Parameters:
parameters- The parameters object to check- Returns:
- Returns the interface type that is required by the parameters, or nw_interface_type_other_t if no interface type is required. API-Since: 12.0
-
nw_parameters_prohibit_interface_type
public static void nw_parameters_prohibit_interface_type(@NotNull @NotNull nw_parameters_t parameters, int interface_type)[@function] nw_parameters_prohibit_interface_type Prohibit any connections or listeners using these parameters from using the provided network interface type.- Parameters:
parameters- The parameters object to configureinterface_type- The interface type to prohibit for connections or listeners. API-Since: 12.0
-
nw_parameters_clear_prohibited_interface_types
public static void nw_parameters_clear_prohibited_interface_types(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_clear_prohibited_interface_types Clear any interface types that had been prohibited.- Parameters:
parameters- The parameters object to modify API-Since: 12.0
-
nw_parameters_iterate_prohibited_interface_types
public static void nw_parameters_iterate_prohibited_interface_types(@NotNull @NotNull nw_parameters_t parameters, @NotNull @NotNull Network.Block_nw_parameters_iterate_prohibited_interface_types iterate_block)[@function] nw_parameters_iterate_prohibited_interface_types List all prohibited network interface types.- Parameters:
parameters- The parameters object to checkiterate_block- A block that will return the interface types prohibited by the parameters. Returning true from the block will continue to iterate, and returning false will stop iterating. API-Since: 12.0
-
nw_parameters_set_prohibit_expensive
public static void nw_parameters_set_prohibit_expensive(@NotNull @NotNull nw_parameters_t parameters, boolean prohibit_expensive)[@function] nw_parameters_set_prohibit_expensive Prohibit any connections or listeners using these parameters from using a network interface that is considered expensive by the system.- Parameters:
parameters- The parameters object to configureprohibit_expensive- If true, prohibit the use of any expensive interfaces. If false, allow expensive interfaces. Defaults to false. API-Since: 12.0
-
nw_parameters_get_prohibit_expensive
public static boolean nw_parameters_get_prohibit_expensive(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_prohibit_expensive Check if the parameters prohibit expensive interfaces.- Parameters:
parameters- The parameters object to check- Returns:
- Returns true if expensive interfaces are prohibited, or false otherwise. API-Since: 12.0
-
nw_parameters_set_prohibit_constrained
public static void nw_parameters_set_prohibit_constrained(@NotNull @NotNull nw_parameters_t parameters, boolean prohibit_constrained)[@function] nw_parameters_set_prohibit_constrained Prohibit any connections or listeners using these parameters from using a network interface that is considered constrained by the system.- Parameters:
parameters- The parameters object to configureprohibit_constrained- If true, prohibit the use of any constrained interfaces. If false, allow constrained interfaces. Defaults to false. API-Since: 13.0
-
nw_parameters_get_prohibit_constrained
public static boolean nw_parameters_get_prohibit_constrained(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_prohibit_constrained Check if the parameters prohibit constrained interfaces.- Parameters:
parameters- The parameters object to check- Returns:
- Returns true if constrained interfaces are prohibited, or false otherwise. API-Since: 13.0
-
nw_parameters_set_reuse_local_address
public static void nw_parameters_set_reuse_local_address(@NotNull @NotNull nw_parameters_t parameters, boolean reuse_local_address)[@function] nw_parameters_set_reuse_local_address Allow any connections using these parameters to reuse local addresses already in use by other connections.- Parameters:
parameters- The parameters object to configurereuse_local_address- If true, allow the reuse of local addresses. If false, disallow the reuse of local addresses. Defaults to false. API-Since: 12.0
-
nw_parameters_get_reuse_local_address
public static boolean nw_parameters_get_reuse_local_address(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_reuse_local_address Check if the parameters allow local address reuse.- Parameters:
parameters- The parameters object to check- Returns:
- Returns true if local address reuse is allowed, or false otherwise. API-Since: 12.0
-
nw_parameters_set_local_endpoint
public static void nw_parameters_set_local_endpoint(@NotNull @NotNull nw_parameters_t parameters, @Nullable @Nullable nw_endpoint_t local_endpoint)[@function] nw_parameters_set_local_endpoint Specify a specific endpoint to use as the local endpoint. For connections, this will be used to initiate traffic; for listeners, this will be used for receiving incoming connections.- Parameters:
parameters- The parameters object to configurelocal_endpoint- The endpoint to set as the local endpoint. Pass NULL to clear the local endpoint. API-Since: 12.0
-
nw_parameters_copy_local_endpoint
@Nullable public static @Nullable nw_endpoint_t nw_parameters_copy_local_endpoint(@NotNull @NotNull nw_parameters_t parameters)
[@function] nw_parameters_copy_local_endpoint Extract the local endpoint set on the connection.- Parameters:
parameters- The parameters object to configure- Returns:
- Returns the endpoint that is set in the parameters, or NULL if no local endpoint is set. API-Since: 12.0
-
nw_parameters_set_include_peer_to_peer
public static void nw_parameters_set_include_peer_to_peer(@NotNull @NotNull nw_parameters_t parameters, boolean include_peer_to_peer)[@function] nw_parameters_set_include_peer_to_peer Allow the inclusion of peer-to-peer interfaces when listening or establishing outbound connections. This parameter will not take effect if a specific interface is required. This parameter is applicable when advertising a Bonjour service on a listener, or connecting to a Bonjour service.- Parameters:
parameters- The parameters object to configureinclude_peer_to_peer- If true, allow advertising, resolving, and connecting over peer-to-peer interfaces. Defaults to false. API-Since: 12.0
-
nw_parameters_get_include_peer_to_peer
public static boolean nw_parameters_get_include_peer_to_peer(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_include_peer_to_peer Check if the parameters allow the inclusion of peer-to-peer interfaces.- Parameters:
parameters- The parameters object to check- Returns:
- Returns true if peer-to-peer interfaces are allowed, or false otherwise. API-Since: 12.0
-
nw_parameters_set_fast_open_enabled
public static void nw_parameters_set_fast_open_enabled(@NotNull @NotNull nw_parameters_t parameters, boolean fast_open_enabled)[@function] nw_parameters_set_fast_open_enabled Use fast open for an outbound connection, which may be done at any protocol level. Use of fast open requires that the caller send idempotent data on the connection before the connection may move into the ready state. As a side effect, this may implicitly enable fast open or early data for protocols in the stack, even if they did not have fast open explicitly enabled on them (such as the option to enable TCP Fast Open). NOTE: Use of this API may have security implications for application data. In particular, TLS early data is replayable by a network attacker. Callers must account for this when sending data before the handshake is confirmed. See RFC 8446 for more information. Callers MUST NOT enable fast open without a specific application profile that defines its use.- Parameters:
parameters- The parameters object to configurefast_open_enabled- If true, indicate that fast open is requested and that idempotent data MUST be sent by the caller on the connection. If false, disallow the fast open at the top level protocol. Defaults to false. API-Since: 12.0
-
nw_parameters_get_fast_open_enabled
public static boolean nw_parameters_get_fast_open_enabled(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_fast_open_enabled Check if the parameters allow the use of fast open for the top level protocol.- Parameters:
parameters- The parameters object to check- Returns:
- Returns true if fast open is allowed for the top level protocol, or false otherwise. API-Since: 12.0
-
nw_parameters_set_service_class
public static void nw_parameters_set_service_class(@NotNull @NotNull nw_parameters_t parameters, int service_class)[@function] nw_parameters_set_service_class Set the data service class to use for connections.- Parameters:
parameters- The parameters object to configureservice_class- The service class value to use for connections. Defaults to nw_service_class_best_effort. API-Since: 12.0
-
nw_parameters_get_service_class
public static int nw_parameters_get_service_class(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_service_class Check the service class configured on the parameters.- Parameters:
parameters- The parameters object to check- Returns:
- Returns the effective service class configured on the parameters. API-Since: 12.0
-
nw_parameters_set_multipath_service
public static void nw_parameters_set_multipath_service(@NotNull @NotNull nw_parameters_t parameters, int multipath_service)[@function] nw_parameters_set_multipath_service Set the multipath service to use for connections.- Parameters:
parameters- The parameters object to configuremultipath_service- The multipath service value to use for connections. Defaults to nw_multipath_service_disabled. API-Since: 12.0
-
nw_parameters_get_multipath_service
public static int nw_parameters_get_multipath_service(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_multipath_service Check the multipath service mode configured on the parameters.- Parameters:
parameters- The parameters object to check- Returns:
- Returns the multipath service configured on the parameters. API-Since: 12.0
-
nw_parameters_copy_default_protocol_stack
@NotNull public static @NotNull nw_protocol_stack_t nw_parameters_copy_default_protocol_stack(@NotNull @NotNull nw_parameters_t parameters)
[@function] nw_parameters_copy_default_protocol_stack Retrieve the default protocol stack from a parameters object. Every parameters object will have a default protocol stack. For parameters created with a convenience initializer, this protocol stack will be pre-populated. For parameters created with the generic initializers, the stack will be empty.- Parameters:
parameters- The parameters object to check- Returns:
- Returns an nw_protocol_stack_t object that can be inspected and modified. API-Since: 12.0
-
nw_protocol_stack_prepend_application_protocol
public static void nw_protocol_stack_prepend_application_protocol(@NotNull @NotNull nw_protocol_stack_t stack, @NotNull @NotNull nw_protocol_options_t protocol)[@function] nw_protocol_stack_prepend_application_protocol Prepend an application-layer protocol onto the top of a protocol stack.- Parameters:
stack- The protocol stack to modifyprotocol- The protocol options to add to the stack, which contain the definition of the protocol to add. API-Since: 12.0
-
nw_protocol_stack_clear_application_protocols
public static void nw_protocol_stack_clear_application_protocols(@NotNull @NotNull nw_protocol_stack_t stack)[@function] nw_protocol_stack_clear_application_protocols Remove all application-layer protocols from a protocol stack.- Parameters:
stack- The protocol stack to modify API-Since: 12.0
-
nw_protocol_stack_iterate_application_protocols
public static void nw_protocol_stack_iterate_application_protocols(@NotNull @NotNull nw_protocol_stack_t stack, @NotNull @NotNull Network.Block_nw_protocol_stack_iterate_application_protocols iterate_block)[@function] nw_protocol_stack_iterate_application_protocols List all application protocols attached to a protocol stack.- Parameters:
stack- The protocol stack to checkiterate_block- A block that will return the protocols attached to the stack. API-Since: 12.0
-
nw_protocol_stack_copy_transport_protocol
@Nullable public static @Nullable nw_protocol_options_t nw_protocol_stack_copy_transport_protocol(@NotNull @NotNull nw_protocol_stack_t stack)
[@function] nw_protocol_stack_copy_transport_protocol Access the transport-layer protocol used in a protocol stack.- Parameters:
stack- The protocol stack to check- Returns:
- Returns the transport protocol currently set in the protocol stack, or NULL if no transport protocol is set. API-Since: 12.0
-
nw_protocol_stack_set_transport_protocol
public static void nw_protocol_stack_set_transport_protocol(@NotNull @NotNull nw_protocol_stack_t stack, @NotNull @NotNull nw_protocol_options_t protocol)[@function] nw_protocol_stack_set_transport_protocol Set the transport-layer protocol to use for a protocol stack.- Parameters:
stack- The protocol stack to modifyprotocol- The protocol options to set into the stack, which contain the definition of the protocol. API-Since: 12.0
-
nw_protocol_stack_copy_internet_protocol
@Nullable public static @Nullable nw_protocol_options_t nw_protocol_stack_copy_internet_protocol(@NotNull @NotNull nw_protocol_stack_t stack)
[@function] nw_protocol_stack_copy_internet_protocol Access the internet-layer protocol used in a protocol stack.- Parameters:
stack- The protocol stack to check- Returns:
- Returns the internet protocol currently set in the protocol stack, or NULL if no internet protocol is set. Note that this will generally be NULL, unless a specific IP family is being selected. API-Since: 12.0
-
nw_parameters_set_local_only
public static void nw_parameters_set_local_only(@NotNull @NotNull nw_parameters_t parameters, boolean local_only)[@function] nw_parameters_set_local_only Set to true to limit inbound connections to peers attached to the local link only. Defaults to false.- Parameters:
parameters- The parameters object to configurelocal_only- True to limit connections to the local link only. API-Since: 12.0
-
nw_parameters_get_local_only
public static boolean nw_parameters_get_local_only(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_local_only Indicates whether or not the parameters limit connections to the local link only.- Parameters:
parameters- The parameters object to check- Returns:
- Returns true if the parameters limit inbound connections to the local link. API-Since: 12.0
-
nw_parameters_set_prefer_no_proxy
public static void nw_parameters_set_prefer_no_proxy(@NotNull @NotNull nw_parameters_t parameters, boolean prefer_no_proxy)[@function] nw_parameters_set_prefer_no_proxy Set to true to attempt connections without using proxies, only using any configured proxies if the connections cannot otherwise be completed. Defaults to false.- Parameters:
parameters- The parameters to modify.prefer_no_proxy- True to cause connections to be attempted without proxies. API-Since: 12.0
-
nw_parameters_get_prefer_no_proxy
public static boolean nw_parameters_get_prefer_no_proxy(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_prefer_no_proxy Indicates whether or not the parameters cause connections to be attempted without proxies, only using proxies if connections cannot otherwise be completed.- Parameters:
parameters- The parameters to get the property from.- Returns:
- Returns true if the parameters cause connections to be attempted without proxies, only using proxies if connections cannot otherwise be completed. API-Since: 12.0
-
nw_parameters_set_expired_dns_behavior
public static void nw_parameters_set_expired_dns_behavior(@NotNull @NotNull nw_parameters_t parameters, int expired_dns_behavior)[@function] nw_parameters_set_expired_dns_behavior Allow or prohibit the use of expired DNS answers during connection establishment. If allowed, a DNS answer that was previously returned may be re-used for new connections even after the answers are considered expired. A query for fresh answers will be sent in parallel, and the fresh answers will be used as alternate addresses in case the expired answers do not result in successful connections. By default, this value is nw_parameters_expired_dns_behavior_default, which allows the system to determine if it is appropriate to use expired answers.- Parameters:
parameters- The parameters to modify.expired_dns_behavior- Allow, prohibit, or use system default behavior for expired DNS answers. API-Since: 12.0
-
nw_parameters_get_expired_dns_behavior
public static int nw_parameters_get_expired_dns_behavior(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_expired_dns_behavior Check the effective expired DNS behavior of a connection. See nw_parameters_set_expired_dns_behavior() for a discussion on the use of expired DNS answers.- Parameters:
parameters- The parameters to check.- Returns:
- Returns the current effective expired DNS answer behavior. API-Since: 12.0
-
nw_browse_descriptor_create_bonjour_service
@NotNull public static @NotNull nw_browse_descriptor_t nw_browse_descriptor_create_bonjour_service(@NotNull @NotNull java.lang.String type, @Nullable @Nullable java.lang.String domain)
[@function] nw_browse_descriptor_create_bonjour_service Creates a new browse descriptor object on a Bonjour service type and domain.- Parameters:
type- A Bonjour service type.domain- An optional Bonjour service domain. If the domain is unspecified, the default domains for browsing will be used.- Returns:
- An instantiated browse descriptor object. API-Since: 13.0
-
nw_browse_descriptor_get_bonjour_service_type
@NotNull public static @NotNull java.lang.String nw_browse_descriptor_get_bonjour_service_type(@NotNull @NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_bonjour_service_type Returns the service type of a browse descriptor.- Parameters:
descriptor- A browse descriptor object.- Returns:
- The service type. API-Since: 13.0
-
nw_browse_descriptor_get_bonjour_service_domain
@Nullable public static @Nullable java.lang.String nw_browse_descriptor_get_bonjour_service_domain(@NotNull @NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_bonjour_service_domain Returns the service domain of a browse descriptor, or NULL if NULL was provided while creating the descriptor.- Parameters:
descriptor- A browse descriptor object.- Returns:
- The service domain. API-Since: 13.0
-
nw_browse_descriptor_set_include_txt_record
public static void nw_browse_descriptor_set_include_txt_record(@NotNull @NotNull nw_browse_descriptor_t descriptor, boolean include_txt_record)[@function] nw_browse_descriptor_set_include_txt_record Set a flag to allow or prohibit the browser from querying for TXT records while browsing. This flag should only be set if the client needs information from the TXT record during browsing, and may increase network traffic. By default, the browser will not automatically query for TXT records.- Parameters:
descriptor- The browse descriptor object.include_txt_record- A flag indicating whether results should include a TXT record. If true, the browser will query for TXT records. If false, the browser will not query for TXT records. API-Since: 13.0
-
nw_browse_descriptor_get_include_txt_record
public static boolean nw_browse_descriptor_get_include_txt_record(@NotNull @NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_include_txt_record Check whether the browser is allowed to query for TXT records.- Parameters:
descriptor- The browse descriptor to check.- Returns:
- Whether the browser is allowed to query for TXT records. API-Since: 13.0
-
nw_browse_result_copy_endpoint
@NotNull public static @NotNull nw_endpoint_t nw_browse_result_copy_endpoint(@NotNull @NotNull nw_browse_result_t result)
[@function] nw_browse_result_copy_endpoint Copies the endpoint associated with the browse result object.- Parameters:
result- The browse result object.- Returns:
- The associated endpoint. API-Since: 13.0
-
nw_browse_result_get_changes
public static long nw_browse_result_get_changes(@Nullable @Nullable nw_browse_result_t old_result, @Nullable @Nullable nw_browse_result_t new_result)[@function] nw_browse_result_get_changes Determines the set of all changes that occurred between an old and a new browse result. For example, if the return value of this function matches with nw_browse_result_change_interface_added and nw_browse_result_change_txt_record_changed, the caller can expect new_result to include a new interface and an updated txt record that was not present in old_result.- Parameters:
old_result- The old result.new_result- The new result.- Returns:
- A nw_browse_result_change_t describing all changes that occurred. API-Since: 13.0
-
nw_browse_result_get_interfaces_count
public static long nw_browse_result_get_interfaces_count(@NotNull @NotNull nw_browse_result_t result)[@function] nw_browse_result_get_interfaces_count Returns the number of interfaces on this browse result.- Parameters:
result- The browse result object.- Returns:
- The number of interfaces available. API-Since: 13.0
-
nw_browse_result_copy_txt_record_object
@Nullable public static @Nullable nw_txt_record_t nw_browse_result_copy_txt_record_object(@NotNull @NotNull nw_browse_result_t result)
[@function] nw_browse_result_copy_txt_record_object Copies the TXT record object from the browse result.- Parameters:
result- The browse result object.- Returns:
- A copy of the TXT record object, or NULL if the browse result does not have an associated TXT record. API-Since: 13.0
-
nw_browse_result_enumerate_interfaces
public static void nw_browse_result_enumerate_interfaces(@NotNull @NotNull nw_browse_result_t result, @NotNull @NotNull Network.Block_nw_browse_result_enumerate_interfaces enumerator)[@function] nw_browse_result_enumerate_interfaces Enumerates the list of interfaces on this browse result.- Parameters:
result- The browse result object.enumerator- The enumerator block. API-Since: 13.0
-
nw_error_get_error_domain
public static int nw_error_get_error_domain(@NotNull @NotNull nw_error_t error)[@function] nw_error_get_error_domain Given a reference to a nw_error, returns the error domain. [@returns] The error domain. API-Since: 12.0- Parameters:
error- A reference to the nw_error.
-
nw_error_get_error_code
public static int nw_error_get_error_code(@NotNull @NotNull nw_error_t error)[@function] nw_error_get_error_code Given a reference to a nw_error, returns the error code. [@returns] The error code. API-Since: 12.0- Parameters:
error- A reference to the nw_error.
-
nw_error_copy_cf_error
@NotNull public static @NotNull CFErrorRef nw_error_copy_cf_error(@NotNull @NotNull nw_error_t error)
[@function] nw_error_copy_cf_error Given a reference to nw_error, returns a CFErrorRef representing the same error. [@returns] The CFErrorRef. The caller is responsible for calling CFRelease on the returned value. API-Since: 12.0- Parameters:
error- A reference to the nw_error.
-
nw_browser_create
@NotNull public static @NotNull nw_browser_t nw_browser_create(@NotNull @NotNull nw_browse_descriptor_t descriptor, @Nullable @Nullable nw_parameters_t parameters)
[@function] nw_browser_create Creates a new browser object, which can be used to browse for results matching a browse descriptor.- Parameters:
descriptor- A browse descriptor object that describes the type of service for which to browse.parameters- Optional parameters to use for the new browser. If NULL, an empty parameters object is created internally.- Returns:
- An instantiated browser object. API-Since: 13.0
-
nw_browser_set_queue
public static void nw_browser_set_queue(@NotNull @NotNull nw_browser_t browser, @NotNull @NotNull dispatch_queue_t queue)[@function] nw_browser_set_queue Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_browser_start().- Parameters:
browser- The browser object.queue- The client's callback queue. API-Since: 13.0
-
nw_browser_set_browse_results_changed_handler
public static void nw_browser_set_browse_results_changed_handler(@NotNull @NotNull nw_browser_t browser, @Nullable @Nullable Network.Block_nw_browser_set_browse_results_changed_handler handler)[@function] nw_browser_set_browse_results_changed_handler Sets a callback handler to be invoked when the browser gets an update for changed browse results. This function must be called before starting the browser and must not be called after starting the browser.- Parameters:
browser- The browser object.handler- The callback handler that fires when the browser gets an update for a changed browse result. API-Since: 13.0
-
nw_browser_set_state_changed_handler
public static void nw_browser_set_state_changed_handler(@NotNull @NotNull nw_browser_t browser, @Nullable @Nullable Network.Block_nw_browser_set_state_changed_handler state_changed_handler)[@function] nw_browser_set_state_changed_handler Sets the state changed handler. For clients that need to perform cleanup when the browser has been cancelled, the nw_browser_state_cancelled state will be delivered last. This function must be called before starting the browser and must not be called after starting the browser.- Parameters:
browser- The browser object.state_changed_handler- The state changed handler to call when the browser state changes. Pass NULL to remove the event handler. API-Since: 13.0
-
nw_browser_start
public static void nw_browser_start(@NotNull @NotNull nw_browser_t browser)[@function] nw_browser_start Starts the browser, which begins browsing for available endpoints. You must call nw_browser_set_queue() before starting the browser.- Parameters:
browser- The browser object. API-Since: 13.0
-
nw_browser_cancel
public static void nw_browser_cancel(@NotNull @NotNull nw_browser_t browser)[@function] nw_browser_cancel Cancels the browser. The process of cancellation will be completed asynchronously, and the final callback event delivered to the caller will be a state update with a value of nw_browser_state_cancelled. Once this update is delivered, the caller may clean up any associated memory or objects.- Parameters:
browser- The browser object. API-Since: 13.0
-
nw_browser_copy_parameters
@NotNull public static @NotNull nw_parameters_t nw_browser_copy_parameters(@NotNull @NotNull nw_browser_t browser)
[@function] nw_browser_copy_parameters Returns a copy of the parameters passed to nw_browser_create().- Parameters:
browser- The browser object.- Returns:
- Returns an nw_parameters_t object. API-Since: 13.0
-
nw_browser_copy_browse_descriptor
@NotNull public static @NotNull nw_browse_descriptor_t nw_browser_copy_browse_descriptor(@NotNull @NotNull nw_browser_t browser)
[@function] nw_browser_copy_browse_descriptor Returns a copy of the browse_descriptor passed to nw_browser_create().- Parameters:
browser- The browser object.- Returns:
- Returns a copy of the browse_descriptor passed to nw_browser_create(). API-Since: 13.0
-
nw_path_get_status
public static int nw_path_get_status(@NotNull @NotNull nw_path_t path)[@function] nw_path_get_status Retrieves the status of a path. The status of a specific path object will never change, as the path object itself is static. If there is a network change, the object that generated the path object will generate a new path object.- Parameters:
path- The path object to check.- Returns:
- Returns the status of the path, or nw_path_status_invalid if the object is NULL. API-Since: 12.0
-
nw_path_enumerate_interfaces
public static void nw_path_enumerate_interfaces(@NotNull @NotNull nw_path_t path, @NotNull @NotNull Network.Block_nw_path_enumerate_interfaces enumerate_block)[@function] nw_path_enumerate_interfaces List all interfaces associated with the path.- Parameters:
path- The path object to check.enumerate_block- A block that will return the interfaces associated with the path. Returning true from the block will continue to enumerate, and returning false will stop enumerating. API-Since: 12.0
-
nw_path_is_equal
public static boolean nw_path_is_equal(@NotNull @NotNull nw_path_t path, @NotNull @NotNull nw_path_t other_path)[@function] nw_path_is_equal Compares two network path objects and checks if their content is equal. If they are not equal, they represent two different network states.- Parameters:
path- The first path object to compare.other_path- The second path object to compare.- Returns:
- Returns true if the paths are equivalent, or false if there is any difference between the paths. API-Since: 12.0
-
nw_path_is_expensive
public static boolean nw_path_is_expensive(@NotNull @NotNull nw_path_t path)[@function] nw_path_is_expensive Checks if the path uses any network interfaces that are considered expensive to the user, such as, but not limited to, a cellular network.- Parameters:
path- The path object to check.- Returns:
- Returns true if the path uses any network interface that is considered expensive, false otherwise. API-Since: 12.0
-
nw_path_is_constrained
public static boolean nw_path_is_constrained(@NotNull @NotNull nw_path_t path)[@function] nw_path_is_constrained Checks if the path uses any network interfaces that are considered constrained to the user.- Parameters:
path- The path object to check.- Returns:
- Returns true if the path uses any network interface that is considered constrained, false otherwise. API-Since: 13.0
-
nw_path_has_ipv4
public static boolean nw_path_has_ipv4(@NotNull @NotNull nw_path_t path)[@function] nw_path_has_ipv4 Checks if the path uses a network interface that supports IPv4 connectivity.- Parameters:
path- The path object to check.- Returns:
- Returns true if the path uses a network interface that supports IPv4, false otherwise. API-Since: 12.0
-
nw_path_has_ipv6
public static boolean nw_path_has_ipv6(@NotNull @NotNull nw_path_t path)[@function] nw_path_has_ipv6 Checks if the path uses a network interface that supports IPv6 connectivity.- Parameters:
path- The path object to check.- Returns:
- Returns true if the path uses a network interface that supports IPv6, false otherwise. API-Since: 12.0
-
nw_path_has_dns
public static boolean nw_path_has_dns(@NotNull @NotNull nw_path_t path)[@function] nw_path_has_dns Checks if the path has a DNS server configuration set.- Parameters:
path- The path object to check.- Returns:
- Returns true if the path has a DNS server configuration set, false otherwise. API-Since: 12.0
-
nw_path_uses_interface_type
public static boolean nw_path_uses_interface_type(@NotNull @NotNull nw_path_t path, int interface_type)[@function] nw_path_uses_interface_type Checks if the path uses a network interface with the specified type.- Parameters:
path- The path object to check.- Returns:
- Returns true if the path uses any network interface with the specified type, false otherwise. API-Since: 12.0
-
nw_path_copy_effective_local_endpoint
@Nullable public static @Nullable nw_endpoint_t nw_path_copy_effective_local_endpoint(@NotNull @NotNull nw_path_t path)
[@function] nw_path_copy_effective_local_endpoint Retrieve the local endpoint that is being used, if present. If this path is the path from an nw_connection_t, it represents the address that data is sent from.- Parameters:
path- The path object to check.- Returns:
- Returns an endpoint that is assigned as the local endpoint for this path, or NULL if the path does not have a fixed local endpoint. API-Since: 12.0
-
nw_path_copy_effective_remote_endpoint
@Nullable public static @Nullable nw_endpoint_t nw_path_copy_effective_remote_endpoint(@NotNull @NotNull nw_path_t path)
[@function] nw_path_copy_effective_remote_endpoint Retrieve the remote endpoint that is being used, if present. If this path is the path from an nw_connection_t, it represents the address that data is sent to.- Parameters:
path- The path object to check.- Returns:
- Returns an endpoint that is assigned as the remote endpoint for this path, or NULL if the path does not have a fixed remote endpoint. API-Since: 12.0
-
nw_path_enumerate_gateways
public static void nw_path_enumerate_gateways(@NotNull @NotNull nw_path_t path, @NotNull @NotNull Network.Block_nw_path_enumerate_gateways enumerate_block)[@function] nw_path_enumerate_gateways List the IP addresses of the routers acting as the gateways for the path.- Parameters:
path- The path object to check.enumerate_block- A block that will return the gateways associated with the path. Returning true from the block will continue to enumerate, and returning false will stop enumerating. API-Since: 13.0
-
nw_content_context_create
@NotNull public static @NotNull nw_content_context_t nw_content_context_create(@NotNull @NotNull java.lang.String context_identifier)
[@function] nw_content_context_create Create a context object to represent properties associated with networking content. If the same context object is associated with multiple content blobs, then those pieces of content will be considered to be continuations of the same message.- Parameters:
context_identifier- A string description of the context- Returns:
- Returns a new context context object API-Since: 12.0
-
nw_content_context_get_identifier
@NotNull public static @NotNull java.lang.String nw_content_context_get_identifier(@NotNull @NotNull nw_content_context_t context)[@function] nw_content_context_get_identifier Access the identifier description.- Returns:
- Returns the context's identifier string. API-Since: 12.0
-
nw_content_context_get_is_final
public static boolean nw_content_context_get_is_final(@NotNull @NotNull nw_content_context_t context)[@function] nw_content_context_get_is_final Check if this is the final context for a connection. When receiving, once a final context is complete, the connection is "read closed" and will not receive more content. See nw_content_context_set_is_final() for a description of how to set is_final for sending contexts.- Parameters:
context- The context object- Returns:
- Returns true if the context is the final context for a connection. API-Since: 12.0
-
nw_content_context_set_is_final
public static void nw_content_context_set_is_final(@NotNull @NotNull nw_content_context_t context, boolean is_final)[@function] nw_content_context_set_is_final Mark whether or not this context is the final context for a connection. When sending, marking a context as final will perform a "write close" once the context is complete, indicating that no more content will be sent. As a convenience for sending a final context, use NW_CONNECTION_FINAL_MESSAGE_CONTEXT.- Parameters:
context- The context objectis_final- If set to true, mark the context as the final context to send on a connection. API-Since: 12.0
-
nw_content_context_get_expiration_milliseconds
public static long nw_content_context_get_expiration_milliseconds(@NotNull @NotNull nw_content_context_t context)[@function] nw_content_context_get_expiration_milliseconds Retrieve the number of milliseconds after which the content will expire. See nw_content_context_set_expiration_milliseconds for further discussion.- Parameters:
context- The context object- Returns:
- Returns content expiration, or 0 if not set. API-Since: 12.0
-
nw_content_context_set_expiration_milliseconds
public static void nw_content_context_set_expiration_milliseconds(@NotNull @NotNull nw_content_context_t context, long expiration_milliseconds)[@function] nw_content_context_set_expiration_milliseconds Set an expiration (in milliseconds) after which content may be dropped. If the expiration time is reached, the content may not be sent. If the value is 0, there is no expiration for the content. The expiration timer starts when the content is enqueued using nw_connection_send().- Parameters:
context- The context objectexpiration_milliseconds- The number of milliseconds after which content will expire API-Since: 12.0
-
nw_content_context_get_relative_priority
public static double nw_content_context_get_relative_priority(@NotNull @NotNull nw_content_context_t context)[@function] nw_content_context_get_relative_priority Get the relative priority for the content. See nw_content_context_set_relative_priority for further discussion.- Parameters:
context- The context object- Returns:
- Returns the relative priority, between 0.0 (lowest priority) to 1.0 (highest priority). The default value is 0.5. API-Since: 12.0
-
nw_content_context_set_relative_priority
public static void nw_content_context_set_relative_priority(@NotNull @NotNull nw_content_context_t context, double relative_priority)[@function] nw_content_context_set_relative_priority Set A relative priority of the content, compared to other content on the same connection. Priorities range from 0.0 (lowest priority) to 1.0 (highest priority), where content with higher priority will scheduled first if all else is equal. The default value is 0.5.- Parameters:
context- The context objectrelative_priority- The relative priority of the content, between 0.0 (lowest priority) to 1.0 (highest priority). API-Since: 12.0
-
nw_content_context_set_antecedent
public static void nw_content_context_set_antecedent(@NotNull @NotNull nw_content_context_t context, @Nullable @Nullable nw_content_context_t antecedent_context)[@function] nw_content_context_set_antecedent Set a context as an antecedent to this content context. The associated content will not be sent until all of its antecedents have been completed. If any of the antecedents fail with an error, this content will fail as well.- Parameters:
context- The context objectantecedent_context- A context associated with content that should precede this content. API-Since: 12.0
-
nw_content_context_copy_antecedent
@Nullable public static @Nullable nw_content_context_t nw_content_context_copy_antecedent(@NotNull @NotNull nw_content_context_t context)
[@function] nw_content_context_copy_antecedent Copy the optional content context that must be sent prior to this content. See nw_content_context_set_antecedent for further discussion.- Parameters:
context- The context object- Returns:
- Returns a context object set as the antecedent, or NULL. API-Since: 12.0
-
nw_content_context_set_metadata_for_protocol
public static void nw_content_context_set_metadata_for_protocol(@NotNull @NotNull nw_content_context_t context, @NotNull @NotNull nw_protocol_metadata_t protocol_metadata)[@function] nw_content_context_set_metadata_for_protocol Set protocol-specific metadata to a parent content context. If metadata for the same protocol is set multiple times, the most recently set metadata will be applied.- Parameters:
context- The context context parent objectprotocol_metadata- The per-protocol metadata context object to set API-Since: 12.0
-
nw_content_context_copy_protocol_metadata
@Nullable public static @Nullable nw_protocol_metadata_t nw_content_context_copy_protocol_metadata(@NotNull @NotNull nw_content_context_t context, @NotNull @NotNull nw_protocol_definition_t protocol)
[@function] nw_content_context_copy_protocol_metadata Copy the per-protocol metadata from a parent content context- Parameters:
context- The context context parent objectprotocol- The definition identifier of the protocol to retrieve metadata for- Returns:
- Returns the metadata registered for the protocol, or NULL if there is none API-Since: 12.0
-
nw_content_context_foreach_protocol_metadata
public static void nw_content_context_foreach_protocol_metadata(@NotNull @NotNull nw_content_context_t context, @NotNull @NotNull Network.Block_nw_content_context_foreach_protocol_metadata foreach_block)[@function] nw_content_context_foreach_protocol_metadata Access all per-protocol metadata objects from a parent content context- Parameters:
context- The context context parent objectforeach_block- A block in which protocol definition and metadata will be sent API-Since: 12.0
-
nw_connection_create
@NotNull public static @NotNull nw_connection_t nw_connection_create(@NotNull @NotNull nw_endpoint_t endpoint, @NotNull @NotNull nw_parameters_t parameters)
[@function] nw_connection_create Creates a networking connection to an endpoint.- Parameters:
endpoint- The remote endpoint to connect to.parameters- The parameters to use for the connection. The data mode, either datagram or stream, must be set.- Returns:
- Returns an allocated nw_connection_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_connection_copy_endpoint
@NotNull public static @NotNull nw_endpoint_t nw_connection_copy_endpoint(@NotNull @NotNull nw_connection_t connection)
[@function] nw_connection_copy_endpoint Retrieves the remote endpoint for a connection.- Parameters:
connection- The connection object.- Returns:
- Returns an nw_endpoint_t object on success. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_connection_copy_parameters
@NotNull public static @NotNull nw_parameters_t nw_connection_copy_parameters(@NotNull @NotNull nw_connection_t connection)
[@function] nw_connection_copy_parameters Retrieves the parameters for a connection.- Parameters:
connection- The connection object.- Returns:
- Returns an nw_parameters_t object on success. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_connection_set_state_changed_handler
public static void nw_connection_set_state_changed_handler(@NotNull @NotNull nw_connection_t connection, @Nullable @Nullable Network.Block_nw_connection_set_state_changed_handler handler)[@function] nw_connection_set_state_changed_handler Sets the state change handler. For clients that need to perform cleanup when the connection has been cancelled, the nw_connection_state_cancelled state will be delivered last.- Parameters:
connection- The connection object.handler- The state changed handler to call when the connection state changes. Pass NULL to remove the state changed handler. API-Since: 12.0
-
nw_connection_set_viability_changed_handler
public static void nw_connection_set_viability_changed_handler(@NotNull @NotNull nw_connection_t connection, @Nullable @Nullable Network.Block_nw_connection_set_viability_changed_handler handler)[@function] nw_connection_set_viability_changed_handler Define a callback to be fired when the viability of the connection changes. This indicates whether or not read and write calls will succeed on a ready connection.- Parameters:
connection- The connection object.handler- The event handler to call when the connection viability changes. The value will be true when the connection is viable, and false otherwise. Pass NULL to remove the event handler. API-Since: 12.0
-
nw_connection_set_better_path_available_handler
public static void nw_connection_set_better_path_available_handler(@NotNull @NotNull nw_connection_t connection, @Nullable @Nullable Network.Block_nw_connection_set_better_path_available_handler handler)[@function] nw_connection_set_better_path_available_handler Define a callback to be fired when a better path is available or not. This indicates whether or not a preferred path is available for the connection.- Parameters:
connection- The connection object.handler- The event handler to call when the better path availability changes. The value will be true when a better path is available, and false otherwise. Pass NULL to remove the event handler. API-Since: 12.0
-
nw_connection_set_path_changed_handler
public static void nw_connection_set_path_changed_handler(@NotNull @NotNull nw_connection_t connection, @Nullable @Nullable Network.Block_nw_connection_set_path_changed_handler handler)[@function] nw_connection_set_path_changed_handler Define a callback to be fired when the connection's path changes.- Parameters:
connection- The connection object.handler- The event handler to call when the connection's path changes. Pass NULL to remove the event handler. API-Since: 12.0
-
nw_connection_set_queue
public static void nw_connection_set_queue(@NotNull @NotNull nw_connection_t connection, @NotNull @NotNull dispatch_queue_t queue)[@function] nw_connection_set_queue Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_connection_start().- Parameters:
connection- The connection object.queue- The client's dispatch queue. API-Since: 12.0
-
nw_connection_start
public static void nw_connection_start(@NotNull @NotNull nw_connection_t connection)[@function] nw_connection_start Starts the connection, which will cause the connection to evaluate its path, do resolution, and try to become readable and writable. Once started, a connection must be cancelled using nw_connection_cancel() or nw_connection_force_cancel() when it is no longer needed.- Parameters:
connection- The connection object. API-Since: 12.0
-
nw_connection_restart
public static void nw_connection_restart(@NotNull @NotNull nw_connection_t connection)[@function] nw_connection_restart Connections in the waiting state will normally re-attempt on network changes. Call nw_connection_restart() to force a connection in the waiting state to retry connection establishment even without a network change. Calls to restart for connections that are not in the waiting state will be ignored.- Parameters:
connection- The connection object. API-Since: 12.0
-
nw_connection_cancel
public static void nw_connection_cancel(@NotNull @NotNull nw_connection_t connection)[@function] nw_connection_cancel Cancel the connection. This will close the connection, and negotiate over the network if applicable for the protocol. The process of cancellation will be completed asynchronously, and the final callback event delivered to the caller will be a state update with a value of nw_connection_state_cancelled. Once this update is delivered, the caller may clean up any associated memory or objects. Outstanding sends and receives will receive errors before the state changes to cancelled. There is no guarantee that any outstanding sends that have not yet delivered send completion handlers will send data before the connection is closed.- Parameters:
connection- The connection object. API-Since: 12.0
-
nw_connection_force_cancel
public static void nw_connection_force_cancel(@NotNull @NotNull nw_connection_t connection)[@function] nw_connection_force_cancel A variant of nw_connection_cancel() that indicates that the protocol stack should not close gracefully, but close as quickly as possible without negotiation. For example, a force close would lead to TCP RST packets being sent, as opposed to negotiating with FIN packets.- Parameters:
connection- The connection object. API-Since: 12.0
-
nw_connection_cancel_current_endpoint
public static void nw_connection_cancel_current_endpoint(@NotNull @NotNull nw_connection_t connection)[@function] nw_connection_cancel_current_endpoint Cancel the currently connected endpoint, causing the connection to fall through to the next endpoint if available, or fail if no more endpoints are available. This is primarily useful for connections which do not have reliable handshakes, such as UDP. If data is sent on the connection with no response, canceling the current endpoint will allow another address or interface to be attempted.- Parameters:
connection- The connection object. API-Since: 12.0
-
nw_connection_receive
public static void nw_connection_receive(@NotNull @NotNull nw_connection_t connection, int minimum_incomplete_length, int maximum_length, @NotNull @NotNull Network.Block_nw_connection_receive completion)[@function] nw_connection_receive Receive data from a connection. This may be called before the connection is ready, in which case the receive request will be queued until the connection is ready. The completion handler will be invoked exactly once for each call, so the client must call this function multiple times to receive multiple chunks of data. For protocols that support flow control, such as TCP, calling receive opens the receive window. If the client stops calling receive, the receive window will fill up and the remote peer will stop sending.- Parameters:
connection- The connection object on which to receive data. The connection should be in the ready state.minimum_incomplete_length- The minimum length to receive from the connection, until the content is complete. Content will be delivered when at least the minimum is available, or the content is complete, whichever comes first.maximum_length- The maximum length to receive from the connection.completion- A callback to be called when content has been received. API-Since: 12.0
-
nw_connection_receive_message
public static void nw_connection_receive_message(@NotNull @NotNull nw_connection_t connection, @NotNull @NotNull Network.Block_nw_connection_receive_message completion)[@function] nw_connection_receive_message Receive a single atomic message from a connection. The completion handler will be invoked exactly once for each call, so the client must call this function multiple times to receive multiple messages.- Parameters:
connection- The connection object on which to receive the message. The connection should be in the ready state.completion- A callback to be called when the message has been received, or an error has occurred. API-Since: 12.0
-
nw_connection_send
public static void nw_connection_send(@NotNull @NotNull nw_connection_t connection, @Nullable @Nullable dispatch_data_t content, @NotNull @NotNull nw_content_context_t context, boolean is_complete, @NotNull @NotNull Network.Block_nw_connection_send completion)[@function] nw_connection_send Send data on a connection. This may be called before the connection is ready, in which case the send will be enqueued until the connection is ready to send. This is an asynchronous send and the completion block can be used to determine when the send is complete. There is nothing preventing a client from issuing an excessive number of outstanding sends. To minimize memory footprint and excessive latency as a consequence of buffer bloat, it is advisable to keep a low number of outstanding sends. The completion block can be used to pace subsequent sends.- Parameters:
connection- The connection object on which to send data.content- A data object to send. This may be NULL only if this send is marking a context (a message or complete connection) as complete in the sending direction.context- The context associated with the content, which represents a logical message to be sent on the connection. All content sent within a single context will be sent as an in-order unit, up until the point that the context is marked complete (see is_complete). Once a context is marked complete, it may be re-used as a new logical message. Protocols like TCP that cannot send multiple independent messages at once (serial streams) will only start processing a new context once the prior context has been marked complete. The context can hold protocol metadata to define how to send content, such as flags for IP packets. The context also can define properties that allow a message to ordered relative to other messages if multiple messages are queued. These properties include relative priority, expiration, and antecedent relationships. Some protocols support re-ordering messages within a single connection. For other protocols that do not, like TCP, these properties still take effect when enqueuing data into the stream's send buffer. The ordering of messages applies to the first calls to send on a given context. In order to close a connection on the sending side (a "write close"), send a context that is marked as "final" and mark is_complete. The convenience definition NW_CONNECTION_FINAL_MESSAGE_CONTEXT may be used to define the default final context for a connection. If the caller wants to treat the entire connection as a single stream, with only one context, set NW_CONNECTION_FINAL_MESSAGE_CONTEXT for all sends; marking is_complete on the final send call will send a "write close". Using NW_CONNECTION_DEFAULT_STREAM_CONTEXT has the same behavior as sending NW_CONNECTION_FINAL_MESSAGE_CONTEXT. To send basic datagrams on a connection, use NW_CONNECTION_DEFAULT_MESSAGE_CONTEXT and pass is_complete as true for each datagram. To send data as a single stream on a connection, use NW_CONNECTION_DEFAULT_STREAM_CONTEXT and pass is_complete as true only to mark the end of the stream.is_complete- A flag indicating if the caller's sending context (logical message) is now complete. Until a context is marked complete, content sent for other contexts may not be sent immediately (if the protocol requires sending bytes serially, like TCP). For datagram protocols, like UDP, is_complete indicates that the content represents a complete datagram. When sending directly on streaming protocols like TCP, is_complete can be used to indicate that the connection should send a "write close" (a TCP FIN) if the sending context is the final context on the connection. Specifically, to send a "write close", pass NW_CONNECTION_FINAL_MESSAGE_CONTEXT or NW_CONNECTION_DEFAULT_STREAM_CONTEXT for the context (or create a custom context and set nw_content_context_set_is_final()), and pass true for is_complete.completion- A callback to be called when the data has been sent, or an error has occurred. This callback does not indicate that the remote side has acknowledged the data. This callback does indicate that the data has either been sent or it has been enqueued to be sent. API-Since: 12.0
-
nw_connection_batch
public static void nw_connection_batch(@NotNull @NotNull nw_connection_t connection, @NotNull @NotNull Network.Block_nw_connection_batch batch_block)[@function] nw_connection_batch Batch several send and/or receive operations together, to hint to the connection that multiple send or receive operations are expected in quick succession.- Parameters:
connection- The connection object.batch_block- The batch block will be invoked immediately upon calling this function. The client may call nw_connection_send() or nw_connection_receive() multiple times within the block, and the connection will attempt to batch these operations when the block returns. API-Since: 12.0
-
nw_connection_copy_description
@NotNull public static @NotNull org.moe.natj.general.ptr.BytePtr nw_connection_copy_description(@NotNull @NotNull nw_connection_t connection)[@function] nw_connection_copy_description Copy a human-readable description of the connection.- Parameters:
connection- The connection object.- Returns:
- Returns a human-readable string description of the connection. The caller must call free() on the string. API-Since: 12.0
-
nw_connection_copy_current_path
@Nullable public static @Nullable nw_path_t nw_connection_copy_current_path(@NotNull @NotNull nw_connection_t connection)
[@function] nw_connection_copy_current_path Copy the current path for a connection. If a connection is established, this will reflect the connected path.- Parameters:
connection- The connection object.- Returns:
- Returns a retained path object, or NULL if the connection has not been started or has been cancelled. API-Since: 12.0
-
nw_connection_copy_protocol_metadata
@Nullable public static @Nullable nw_protocol_metadata_t nw_connection_copy_protocol_metadata(@NotNull @NotNull nw_connection_t connection, @NotNull @NotNull nw_protocol_definition_t definition)
[@function] nw_connection_copy_protocol_metadata Copy the connection-wide metadata for a specific protocol. This allows the caller to introspect per-protocol state, only once the connection has been established. This metadata is also available when receiving data through the content context.- Parameters:
connection- The connection object.definition- The protocol definition for which metadata will be returned.- Returns:
- Returns a retained protocol metadata object, or NULL if the connection has not been established yet or is cancelled. API-Since: 12.0
-
nw_connection_get_maximum_datagram_size
public static int nw_connection_get_maximum_datagram_size(@NotNull @NotNull nw_connection_t connection)[@function] nw_connection_get_maximum_datagram_size Check for the maximum datagram size that can be written on the connection. Any datagrams written should be less than or equal to this size.- Parameters:
connection- The connection object.- Returns:
- Returns a datagram size based on the current MTU and the overhead of the protocols being used. API-Since: 12.0
-
nw_connection_access_establishment_report
public static void nw_connection_access_establishment_report(@NotNull @NotNull nw_connection_t connection, @NotNull @NotNull dispatch_queue_t queue, @NotNull @NotNull Network.Block_nw_connection_access_establishment_report access_block)[@function] nw_connection_access_establishment_report Access the establishment report for a connection. The report will be NULL until the connection is in the "ready" state. The callback block will be invoked exactly once on the provided queue.- Parameters:
connection- An established connection.queue- The dispatch queue on which to call the access_block.access_block- A block to invoke with the establishment report, which may be NULL if the connection not ready. API-Since: 13.0
-
nw_establishment_report_get_duration_milliseconds
public static long nw_establishment_report_get_duration_milliseconds(@NotNull @NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_duration_milliseconds Retrieve the duration of the connection's establishment. This is the total time in milliseconds from when the connection attempt began until the connection becomes ready, including resolution, proxy evaluation, and protocol handshakes.- Parameters:
report- An establishment report.- Returns:
- Returns the number of milliseconds the connection took to establish. API-Since: 13.0
-
nw_establishment_report_get_attempt_started_after_milliseconds
public static long nw_establishment_report_get_attempt_started_after_milliseconds(@NotNull @NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_attempt_started_after_milliseconds Retrieve the delay from calling start() after which the successful connection attempt began. For connections that succeed on the first attempt, this value will be 0. For connections that move into the "waiting" state, this value will be greater than 0.- Parameters:
report- An establishment report.- Returns:
- Returns the number of milliseconds from connection start to the beginning of the successful connection attempt. API-Since: 13.0
-
nw_establishment_report_get_previous_attempt_count
public static int nw_establishment_report_get_previous_attempt_count(@NotNull @NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_previous_attempt_count Retrieve the number of connection attempts made before the successful attempt. For connections that succeed on the first attempt, this value will be 0. For connections that move into the "waiting" state, this value will be greater than 0.- Parameters:
report- An establishment report.- Returns:
- Returns the number of connection attempts made before the successful attempt. API-Since: 13.0
-
nw_establishment_report_get_used_proxy
public static boolean nw_establishment_report_get_used_proxy(@NotNull @NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_used_proxy Check if the connection used a proxy during establishment.- Parameters:
report- An establishment report.- Returns:
- Returns true if the connection used a proxy, false otherwise. API-Since: 13.0
-
nw_establishment_report_get_proxy_configured
public static boolean nw_establishment_report_get_proxy_configured(@NotNull @NotNull nw_establishment_report_t report)[@function] nw_establishment_report_get_proxy_configured Check if a proxy configuration applied to the connection, even if the connection did not end up using a proxy for the successful attempt.- Parameters:
report- An establishment report.- Returns:
- Returns true if a proxy configuration applied to the connection, false otherwise. API-Since: 13.0
-
nw_establishment_report_copy_proxy_endpoint
@Nullable public static @Nullable nw_endpoint_t nw_establishment_report_copy_proxy_endpoint(@NotNull @NotNull nw_establishment_report_t report)
[@function] nw_establishment_report_copy_proxy_endpoint Access the endpoint of the proxy used by a connection, if applicable.- Parameters:
report- An establishment report.- Returns:
- Returns an allocated endpoint object if a proxy was used by the connection, or NULL if no proxy was used. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. API-Since: 13.0
-
nw_establishment_report_enumerate_resolutions
public static void nw_establishment_report_enumerate_resolutions(@NotNull @NotNull nw_establishment_report_t report, @NotNull @NotNull Network.Block_nw_establishment_report_enumerate_resolutions enumerate_block)[@function] nw_establishment_report_enumerate_resolutions Enumerate the steps of connection establishment that involved endpoint resolution, such as DNS hostname resolution and Bonjour service resolution. The provided block will be called inline zero or more times.- Parameters:
report- An establishment report.enumerate_block- A block to be invoked zero or more times, once for each step of resolution used during connection establishment. The values passed to the enumerator are: - source: The source of the resolution (query or cache). - milliseconds: The number of milliseconds spent on this resolution step. - endpoint_count: The number of resolved endpoints discovered by the resolution step. - successful_endpoint: The resolved endpoint that led to a successful connection. - preferred_endpoint: The first resolved endpoint attempted, which may be the same as the successful_endpoint. Returning true from the block indicates that the enumeration should continue. Returning false indicates that the enumeration should stop. API-Since: 13.0
-
nw_establishment_report_enumerate_protocols
public static void nw_establishment_report_enumerate_protocols(@NotNull @NotNull nw_establishment_report_t report, @NotNull @NotNull Network.Block_nw_establishment_report_enumerate_protocols enumerate_block)[@function] nw_establishment_report_enumerate_protocols Enumerate the protocols used in the established connection. The provided block will be called inline zero or more times.- Parameters:
report- An establishment report.enumerate_block- A block to be invoked zero or more times, once for each protocol used in the established connection. The values passed to the enumerator are: - protocol: The protocol definition. - handshake_milliseconds: The number of milliseconds spent on the protocol's handshake. - handshake_rtt_milliseconds: The round trip time in milliseconds measured by the protocol's handshake. Returning true from the block indicates that the enumeration should continue. Returning false indicates that the enumeration should stop. API-Since: 13.0
-
nw_connection_create_new_data_transfer_report
@NotNull public static @NotNull nw_data_transfer_report_t nw_connection_create_new_data_transfer_report(@NotNull @NotNull nw_connection_t connection)
[@function] nw_connection_create_new_data_transfer_report Create a new data transfer report on a connection. Multiple reports may be created for a single connection. The report begins capturing data when the connection becomes ready, or when the report is created (whichever occurs last). Call nw_data_transfer_report_collect() to complete collection of report, after which point the details of the report will be available.- Parameters:
connection- A connection object, in or before the ready state.- Returns:
- Returns an allocated nw_data_transfer_report_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 13.0
-
nw_data_transfer_report_get_state
public static int nw_data_transfer_report_get_state(@NotNull @NotNull nw_data_transfer_report_t report)[@function] nw_data_transfer_report_get_state Access the state of a data transfer report. Once a report is "collected", individual fields may be read.- Parameters:
report- A data transfer report to check.- Returns:
- Returns the current state of the data transfer report. API-Since: 13.0
-
nw_data_transfer_report_collect
public static void nw_data_transfer_report_collect(@NotNull @NotNull nw_data_transfer_report_t report, @NotNull @NotNull dispatch_queue_t queue, @NotNull @NotNull Network.Block_nw_data_transfer_report_collect collect_block)[@function] nw_data_transfer_report_collect Mark a data transfer report as complete, and request collection of values. Once the report has been collected, the callback block will be invoked exactly once on the provided dispatch queue. If a connection is cancelled or fails prior to the report being collected, the report will automatically be collected. Calling nw_data_transfer_report_collect() will be redundant but not harmful.- Parameters:
report- A data transfer report to check.queue- The dispatch queue on which to call the collect_block.collect_block- A block to invoke once the report has been collected. API-Since: 13.0
-
nw_data_transfer_report_get_duration_milliseconds
public static long nw_data_transfer_report_get_duration_milliseconds(@NotNull @NotNull nw_data_transfer_report_t report)[@function] nw_data_transfer_report_get_duration_milliseconds Retrieve the duration of the data transfer report. This is a length of time in milliseconds which can be used to calculate throughput when compared to application and transport byte counts. The start time is calculated from when the report was created, or the connection became ready if the connection was not ready when the report was created. The duration ends when the report is collected, or the connection fails or is cancelled.- Parameters:
report- A data transfer report in the "collected" state.- Returns:
- Returns the duration of the data transport report in milliseconds, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_path_count
public static int nw_data_transfer_report_get_path_count(@NotNull @NotNull nw_data_transfer_report_t report)[@function] nw_data_transfer_report_get_path_count Retrieve the number of paths used by the connection for the duration of the report. Any value greater than or equal to 0 and less than this count may be used as a "path_index" for retrieving specific details from the report.- Parameters:
report- A data transfer report in the "collected" state.- Returns:
- Returns the number of paths used by the connection, which limits the value of the "path_index" parameter used in other report functions. Returns 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_received_ip_packet_count
public static long nw_data_transfer_report_get_received_ip_packet_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_ip_packet_count Retrieve the number of IP packets received on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of IP packets received, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_sent_ip_packet_count
public static long nw_data_transfer_report_get_sent_ip_packet_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_ip_packet_count Retrieve the number of IP packets sent on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of IP packets sent, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_received_transport_byte_count
public static long nw_data_transfer_report_get_received_transport_byte_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_transport_byte_count Retrieve the number of transport protocol bytes (such as TCP stream bytes) received on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of transport protocol bytes received, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_received_transport_duplicate_byte_count
public static long nw_data_transfer_report_get_received_transport_duplicate_byte_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_transport_duplicate_byte_count Retrieve the number of duplicate transport protocol bytes (such as duplicate TCP bytes) received on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of duplicate transport protocol bytes received, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_received_transport_out_of_order_byte_count
public static long nw_data_transfer_report_get_received_transport_out_of_order_byte_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_transport_out_of_order_byte_count Retrieve the number of out-of-order transport protocol bytes (such as out-of-order TCP bytes) received on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of out-of-order transport protocol bytes received, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_sent_transport_byte_count
public static long nw_data_transfer_report_get_sent_transport_byte_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_transport_byte_count Retrieve the number of transport protocol bytes (such as TCP stream bytes) sent on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of transport protocol bytes sent, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_sent_transport_retransmitted_byte_count
public static long nw_data_transfer_report_get_sent_transport_retransmitted_byte_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_transport_retransmitted_byte_count Retrieve the number of retransmitted transport protocol bytes (such as retransmitted TCP bytes) sent on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of retransmitted transport protocol bytes sent, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds
public static long nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds Retrieve the smoothed average for the transport protocol's round trip time (RTT) on a given path for the duration of the report, measured in milliseconds.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. For non-multipath connections, pass 0 as the path index to access the single path. Passing NW_ALL_PATHS for this function is equivalent to passing 0.- Returns:
- Returns the smoothed RTT as measured by the transport protocol, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_transport_minimum_rtt_milliseconds
public static long nw_data_transfer_report_get_transport_minimum_rtt_milliseconds(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_transport_minimum_rtt_milliseconds Retrieve the minimum (best) round trip time (RTT) on a given path for the duration of the report, measured in milliseconds.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. For non-multipath connections, pass 0 as the path index to access the single path. Passing NW_ALL_PATHS for this function is equivalent to passing 0.- Returns:
- Returns the minimum RTT as measured by the transport protocol, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_transport_rtt_variance
public static long nw_data_transfer_report_get_transport_rtt_variance(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_transport_rtt_variance Retrieve the variance of the round trip time (RTT) on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. For non-multipath connections, pass 0 as the path index to access the single path. Passing NW_ALL_PATHS for this function is equivalent to passing 0.- Returns:
- Returns the RTT variance as measured by the transport protocol, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_received_application_byte_count
public static long nw_data_transfer_report_get_received_application_byte_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_received_application_byte_count Retrieve the number of application bytes received on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of application bytes received, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_get_sent_application_byte_count
public static long nw_data_transfer_report_get_sent_application_byte_count(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_sent_application_byte_count Retrieve the number of application bytes sent on a given path for the duration of the report.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function returns the sum of all paths.- Returns:
- Returns the number of application bytes sent, or 0 if the report is not in the "collected" state. API-Since: 13.0
-
nw_data_transfer_report_copy_path_interface
@NotNull public static @NotNull nw_interface_t nw_data_transfer_report_copy_path_interface(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)
[@function] nw_data_transfer_report_copy_path_interface Retrieve the interface used for data transfer for a given path used by a connection.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function is equivalent to passing 0.- Returns:
- Returns a retained nw_interface_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails if the report is not yet collected. API-Since: 13.0
-
nw_framer_protocol_create_message
@NotNull public static @NotNull nw_protocol_metadata_t nw_framer_protocol_create_message(@NotNull @NotNull nw_protocol_definition_t definition)
[@function] nw_framer_protocol_create_message Create an instance of a framer message on which per- message options can be configured when sending data on a connection. This is intended to be used by the application above the connection to send message data down to the framer protocol instance.- Parameters:
definition- The framer protocol definition, as retrieved from nw_protocol_options_copy_definition() on the framer options.- Returns:
- Returns a retained protocol metadata object. API-Since: 13.0
-
nw_protocol_metadata_is_framer_message
public static boolean nw_protocol_metadata_is_framer_message(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_framer_message Checks if a protocol metadata object is a framer protocol message. This indicates whether or not it is compatible with the framer message setters and accessors.- Parameters:
metadata- The protocol metadata to check.- Returns:
- Returns true if the metadata is associated with a framer protocol definition, false otherwise. API-Since: 13.0
-
nw_framer_message_create
@NotNull public static @NotNull nw_protocol_metadata_t nw_framer_message_create(@NotNull @NotNull nw_framer_t framer)
[@function] nw_framer_message_create Create a framer message, given a framer instance. This is intended to be used within the implementation of the framer protocol to create messages that are delivered as input to the application.- Parameters:
framer- The framer instance object.- Returns:
- Returns a retained framer message object. API-Since: 13.0
-
nw_framer_message_set_value
public static void nw_framer_message_set_value(@NotNull @NotNull nw_protocol_metadata_t message, @NotNull @NotNull java.lang.String key, @Nullable @Nullable org.moe.natj.general.ptr.VoidPtr value, @Nullable @Nullable Network.Block_nw_framer_message_set_value dispose_value)[@function] nw_framer_message_set_value Set a key-value pair on a framer message, with a custom dispose function for the value.- Parameters:
message- The framer message object.key- The string key to identify the value.value- A pointer to the value to store.dispose_value- A block to invoke to dispose the stored value. API-Since: 13.0
-
nw_framer_message_access_value
public static boolean nw_framer_message_access_value(@NotNull @NotNull nw_protocol_metadata_t message, @NotNull @NotNull java.lang.String key, @NotNull @NotNull Network.Block_nw_framer_message_access_value access_value)[@function] nw_framer_message_access_value Access the value with a key on a framer message.- Parameters:
message- The framer message object.key- The string key to identify the value.access_value- A block to invoke inline with the pointer to the stored value. This pointer may be NULL if no value is stored for the key.- Returns:
- Returns the boolean value returned by the access_value block, or else false if the parameters were invalid. API-Since: 13.0
-
nw_framer_message_set_object_value
public static void nw_framer_message_set_object_value(@NotNull @NotNull nw_protocol_metadata_t message, @NotNull @NotNull java.lang.String key, @Nullable @Nullable java.lang.Object value)[@function] nw_framer_message_set_object_value Set a key-value pair on a framer message, where the value is a reference-counted object.- Parameters:
message- The framer message object.key- The string key to identify the value.value- A reference counted object to store. API-Since: 13.0
-
nw_framer_message_copy_object_value
@Nullable public static @Nullable java.lang.Object nw_framer_message_copy_object_value(@NotNull @NotNull nw_protocol_metadata_t message, @NotNull @NotNull java.lang.String key)[@function] nw_framer_message_copy_object_value Copy the stored object value using a key on a framer message.- Parameters:
message- The framer message object.key- The string key to identify the value.- Returns:
- Returns a reference counted object with a +1 reference count, or NULL if no value was found for the specified key. API-Since: 13.0
-
nw_framer_create_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_framer_create_definition(@NotNull @NotNull java.lang.String identifier, int flags, @NotNull @NotNull Network.Block_nw_framer_create_definition start_handler)
[@function] nw_framer_create_definition Create a protocol definition for a custom framer protocol.- Parameters:
identifier- A string identifier used to name this framer protocol. This does not define uniqueness, and is primarily used for logging and debugging.flags- Flags to describe extended options on framer protocol behavior, all prefixed with "NW_FRAMER_CREATE_FLAGS_".start_handler- A block to be invoked when starting a new instance of the framer protocol. This may occur more than once for a single nw_connection.- Returns:
- Returns a retained protocol definition that can be used with protocol options and metadata. API-Since: 13.0
-
nw_framer_create_options
@NotNull public static @NotNull nw_protocol_options_t nw_framer_create_options(@NotNull @NotNull nw_protocol_definition_t framer_definition)
[@function] nw_framer_create_options Create protocol options from a framer definition. This object can be added to an nw_protocol_stack_t to be used in an nw_connection_t or an nw_listener_t.- Parameters:
framer_definition- A protocol definition created with nw_framer_create_definition().- Returns:
- Returns a retained protocol options object to add into a protocol stack. API-Since: 13.0
-
nw_framer_set_input_handler
public static void nw_framer_set_input_handler(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull Network.Block_nw_framer_set_input_handler input_handler)[@function] nw_framer_set_input_handler Set a handler block to be invoked whenever new input data is available to be parsed. When this block is run, the implementation should call functions like nw_framer_parse_input() and nw_framer_deliver_input(). Input events are edge triggered. The input_handler block should continue to call nw_framer_parse_input() until nw_framer_parse_input() can no longer produce enough bytes to satisfy the request, or the protocol needs to wait for some other event to continue processing later. This setter is required, and must only be set from within the invocation of a nw_framer_start_handler_t.- Parameters:
framer- The framer instance object, passed via the nw_framer_start_handler_t block.input_handler- The block to invoke whenever new input data is available. API-Since: 13.0
-
nw_framer_set_output_handler
public static void nw_framer_set_output_handler(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull Network.Block_nw_framer_set_output_handler output_handler)[@function] nw_framer_set_output_handler Set a handler block to be invoked whenever an output message is ready to be sent. When this block is run, the implementation should call functions like nw_framer_parse_output() and nw_framer_write_output(). This setter is required, and must only be set from within the invocation of a nw_framer_start_handler_t.- Parameters:
framer- The framer instance object, passed via the nw_framer_start_handler_t block.output_handler- The block to invoke whenever a new output message is ready to be sent. API-Since: 13.0
-
nw_framer_set_wakeup_handler
public static void nw_framer_set_wakeup_handler(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull Network.Block_nw_framer_set_wakeup_handler wakeup_handler)[@function] nw_framer_set_wakeup_handler Set a handler block to be invoked whenever the wakeup timer set via nw_framer_schedule_wakeup() fires. This is intended to be used for sending keepalives or other control traffic. This setter is optional, and must only be set from within the invocation of a nw_framer_start_handler_t.- Parameters:
framer- The framer instance object, passed via the nw_framer_start_handler_t block.wakeup_handler- The block to invoke whenever the timeout set by nw_framer_schedule_wakeup() is reached. API-Since: 13.0
-
nw_framer_set_stop_handler
public static void nw_framer_set_stop_handler(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull Network.Block_nw_framer_set_stop_handler stop_handler)[@function] nw_framer_set_stop_handler Set a handler block to be invoked when the connection is being disconnected, to allow the framer implementation a chance to send any final data. This setter is optional, and must only be set from within the invocation of a nw_framer_start_handler_t.- Parameters:
framer- The framer instance object, passed via the nw_framer_start_handler_t block.stop_handler- The block to invoke when the connection is disconnected. API-Since: 13.0
-
nw_framer_set_cleanup_handler
public static void nw_framer_set_cleanup_handler(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull Network.Block_nw_framer_set_cleanup_handler cleanup_handler)[@function] nw_framer_set_cleanup_handler Set a handler block to be invoked when the protocol stack is being torn down and deallocated. This is the opportunity for the framer implementation to release any state it may have saved. This setter is optional, and must only be set from within the invocation of a nw_framer_start_handler_t.- Parameters:
framer- The framer instance object, passed via the nw_framer_start_handler_t block.cleanup_handler- The block to invoke when the protocol stack is being deallocated. API-Since: 13.0
-
nw_framer_mark_ready
public static void nw_framer_mark_ready(@NotNull @NotNull nw_framer_t framer)[@function] nw_framer_mark_ready Mark the connection associated with the framer instance as ready (see nw_connection_state_ready). This is intended to be used by protocols that require a handshake before being able to send application data. This should only be called if the return value to the nw_framer_start_handler_t block was nw_framer_start_result_will_call_ready. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object. API-Since: 13.0
-
nw_framer_prepend_application_protocol
public static boolean nw_framer_prepend_application_protocol(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull nw_protocol_options_t protocol_options)[@function] nw_framer_prepend_application_protocol Dynamically add a protocol to a connection establishment attempt "above" the framer protocol. This means that the protocol above will start running once the framer becomes ready by calling nw_framer_mark_ready(). This can only be used with framers that return a value of nw_framer_start_result_will_call_ready to their start handlers. An example of using this functionality is adding a security protocol, like TLS, above a framer once that framer completes its initial handshake. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.protocol_options- Protocol options for an application protocol to dynamically add "above" the framer.- Returns:
- Returns true if the protocol was successfully added, or false it it could not be added. This will fail if the framer is already marked ready. API-Since: 13.0
-
nw_framer_mark_failed_with_error
public static void nw_framer_mark_failed_with_error(@NotNull @NotNull nw_framer_t framer, int error_code)[@function] nw_framer_mark_failed_with_error Mark the connection associated with the framer instance as failed (see nw_connection_state_failed). To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.error_code- An error code to describe why the connection failed. API-Since: 13.0
-
nw_framer_parse_input
public static boolean nw_framer_parse_input(@NotNull @NotNull nw_framer_t framer, long minimum_incomplete_length, long maximum_length, @Nullable @Nullable org.moe.natj.general.ptr.BytePtr temp_buffer, @NotNull @NotNull Network.Block_nw_framer_parse_input parse)[@function] nw_framer_parse_input Parse currently available input from the location of the input cursor in the stream or message being parsed. The parse completion block will always be invoked inline exactly once. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.minimum_incomplete_length- The minimum number of bytes to parse. If this amount is not available, the parse completion block will be invoked with 0 bytes.maximum_length- The maximum number of bytes to parse as a contiguous buffer. If temp_buffer is not NULL, then this represents the length of valid bytes in temp_buffer.temp_buffer- A buffer provided by the caller to copy parse bytes into. If it is not NULL, it must have at least maximum_length bytes available, and any parsed bytes will be copied into the buffer. Any data stored in temp_buffer will be overwritten. If it is NULL, the buffer provided in the completion will not copy unless a copy is required to provide the minimum bytes as a contiguous buffer. The temp_buffer allows the caller to guarantee alignment properties of the buffer it parses.parse- The completion that provides the bytes to parse, which will be called exactly once.- Returns:
- Returns true if the parse succeeded, or false if not enough bytes were available. API-Since: 13.0
-
nw_framer_deliver_input
public static void nw_framer_deliver_input(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull java.lang.String input_buffer, long input_length, @NotNull @NotNull nw_protocol_metadata_t message, boolean is_complete)[@function] nw_framer_deliver_input Deliver arbitrary data to the application. This is intended to deliver any data that is generated or transformed by the protocol instance. It will incur a copy of bytes. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.input_buffer- The bytes to deliver to the application. This must be non-NULL. If an empty message needs to be delivered, use nw_framer_deliver_input_no_copy().input_length- The length of input_buffer. This must be non-zero.message- The message to associate with the received data.is_complete- A boolean indicating whether or not this data represents the end of the message. API-Since: 13.0
-
nw_framer_deliver_input_no_copy
public static boolean nw_framer_deliver_input_no_copy(@NotNull @NotNull nw_framer_t framer, long input_length, @NotNull @NotNull nw_protocol_metadata_t message, boolean is_complete)[@function] nw_framer_deliver_input_no_copy Deliver bytes directly to the application without any transformation or copy. The bytes will start at the current input cursor used for parsing, and will implicitly advance the cursor by the length being delivered. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.input_length- The number of input bytes to deliver. This will advance the parsing cursor by the specified number of bytes. The length may be 0, which can be used to indicate the end of the message if is_complete is set.message- The message to associate with the received data.is_complete- A boolean indicating whether or not this data represents the end of the message.- Returns:
- Returns true if the input was delivered immediately, or false if it will be delivered once more bytes become available. API-Since: 13.0
-
nw_framer_pass_through_input
public static void nw_framer_pass_through_input(@NotNull @NotNull nw_framer_t framer)[@function] nw_framer_pass_through_input Mark the input side of the framer as a pass-through, which means the framer will not be notified of any further input data. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object. API-Since: 13.0
-
nw_framer_parse_output
public static boolean nw_framer_parse_output(@NotNull @NotNull nw_framer_t framer, long minimum_incomplete_length, long maximum_length, @Nullable @Nullable org.moe.natj.general.ptr.BytePtr temp_buffer, @NotNull @NotNull Network.Block_nw_framer_parse_output parse)[@function] nw_framer_parse_output Parse currently available output from a message from the location of the output cursor in the message being parsed. The parse completion block will always be invoked inline exactly once. This function must only be called from within the output handler set with nw_framer_set_output_handler().- Parameters:
framer- The framer instance object.minimum_incomplete_length- The minimum number of bytes to parse. If this amount is not available, the parse completion block will be invoked with 0 bytes.maximum_length- The maximum number of bytes to parse as a contiguous buffer. If temp_buffer is not NULL, then this represents the length of valid bytes in temp_buffer.temp_buffer- A buffer provided by the caller to copy parse bytes into. If it is not NULL, it must have at least maximum_length bytes available, and any parsed bytes will be copied into the buffer. Any data stored in temp_buffer will be overwritten. If it is NULL, the buffer provided in the completion will not copy unless a copy is required to provide the minimum bytes as a contiguous buffer. The temp_buffer allows the caller to guarantee alignment properties of the buffer it parses.parse- The completion that provides the bytes to parse, which will be called exactly once.- Returns:
- Returns true if the parse succeeded, or false if not enough bytes were available. API-Since: 13.0
-
nw_framer_write_output
public static void nw_framer_write_output(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull java.lang.String output_buffer, long output_length)[@function] nw_framer_write_output Write arbitrary bytes as part of an outbound message. This is intended to be used for adding headers around application data, or writing any other data that is generated or transformed by the protocol instance. It does not pass along data directly from the application. This variant will copy bytes. This function may be called as part of any framer callback, not just the output handler. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.output_buffer- The bytes to write.output_length- The length of output_buffer. API-Since: 13.0
-
nw_framer_write_output_data
public static void nw_framer_write_output_data(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull dispatch_data_t output_data)[@function] nw_framer_write_output_data Write arbitrary bytes as part of an outbound message. This is intended to be used for adding headers around application data, or writing any other data that is generated or transformed by the protocol instance. It does not pass along data directly from the application. This variant is the same as nw_framer_write_output(), but allows the implementation to pass its buffer as a dispatch_data_t to avoid a copy. This function may be called as part of any framer callback, not just the output handler. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.output_data- A dispatch_data_t to write. API-Since: 13.0
-
nw_framer_write_output_no_copy
public static boolean nw_framer_write_output_no_copy(@NotNull @NotNull nw_framer_t framer, long output_length)[@function] nw_framer_write_output_no_copy Write bytes directly from the application without any transformation or copy. The bytes will start at the current output cursor used for parsing, and will implicitly advance the cursor by the length being written. This function must only be called from within the output handler set with nw_framer_set_output_handler(). To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.output_length- The number of application bytes to write. This will advance the parsing cursor by the specified number of bytes.- Returns:
- Returns true if the write could be completed, otherwise false if the call was made from an invalid context or with an invalid number of bytes. API-Since: 13.0
-
nw_framer_pass_through_output
public static void nw_framer_pass_through_output(@NotNull @NotNull nw_framer_t framer)[@function] nw_framer_pass_through_output Mark the output side of the framer as a pass-through, which means the framer will not be notified of any further output data. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object. API-Since: 13.0
-
nw_framer_schedule_wakeup
public static void nw_framer_schedule_wakeup(@NotNull @NotNull nw_framer_t framer, long milliseconds)[@function] nw_framer_schedule_wakeup Schedule a wakeup on the framer instance for a number of milliseconds into the future. If this is called multiple times before the timeout is reached, the new value replaces the previous value. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance object.milliseconds- The number of milliseconds into the future at which to invoke the wakeup handler. Pass the reserved value NW_FRAMER_WAKEUP_TIME_FOREVER to push the wakeup timer out to "forever", effectively unscheduling the timer. API-Since: 13.0
-
nw_framer_async
public static void nw_framer_async(@NotNull @NotNull nw_framer_t framer, @NotNull @NotNull Network.Block_nw_framer_async async_block)[@function] nw_framer_async Schedule a block asynchronously on the framer instance. This must be used anytime the caller wants to perform any other action on the framer instance while not directly in the call stack of a callback from the framer.- Parameters:
framer- The framer instance object.async_block- A block to execute on the correct scheduling context for the framer instance. API-Since: 13.0
-
nw_framer_copy_remote_endpoint
@NotNull public static @NotNull nw_endpoint_t nw_framer_copy_remote_endpoint(@NotNull @NotNull nw_framer_t framer)
[@function] nw_framer_copy_remote_endpoint Access the remote endpoint being used for a given instance of a framer. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance.- Returns:
- Returns a retained endpoint object representing the remote side of a connection. API-Since: 13.0
-
nw_framer_copy_local_endpoint
@NotNull public static @NotNull nw_endpoint_t nw_framer_copy_local_endpoint(@NotNull @NotNull nw_framer_t framer)
[@function] nw_framer_copy_local_endpoint Access the local endpoint being used for a given instance of a framer. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance.- Returns:
- Returns a retained endpoint object representing the local side of a connection. API-Since: 13.0
-
nw_framer_copy_parameters
@NotNull public static @NotNull nw_parameters_t nw_framer_copy_parameters(@NotNull @NotNull nw_framer_t framer)
[@function] nw_framer_copy_parameters Access the parameters being used for a given instance of a framer. To ensure thread safety, this function can only be called in one of the callback blocks invoked on the framer, or in a block passed to nw_framer_async().- Parameters:
framer- The framer instance.- Returns:
- Returns a retained parameters object. API-Since: 13.0
-
nw_protocol_copy_ip_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_copy_ip_definition()
[@function] nw_protocol_copy_ip_definition Access the definition of the default system protocol implementation of IP (Internet Protocol). This protocol can be used as part of a connection's protocol stack as the internet protocol.- Returns:
- Returns a retained protocol definition object. API-Since: 12.0
-
nw_ip_options_set_version
public static void nw_ip_options_set_version(@NotNull @NotNull nw_protocol_options_t options, int version)[@function] nw_ip_options_set_version Specify a single version of the Internet Protocol to allow. Setting this value will constrain which address endpoints can be used, and will filter DNS results during connection establishment.- Parameters:
options- An IP protocol options object.version- A specific, restricted IP version. API-Since: 12.0
-
nw_ip_options_set_hop_limit
public static void nw_ip_options_set_hop_limit(@NotNull @NotNull nw_protocol_options_t options, byte hop_limit)[@function] nw_ip_options_set_hop_limit Configure the IP hop limit (or 'TTL' for IPv4).- Parameters:
options- An IP protocol options object.hop_limit- The hop limit to set on outgoing IP packets. API-Since: 12.0
-
nw_ip_options_set_use_minimum_mtu
public static void nw_ip_options_set_use_minimum_mtu(@NotNull @NotNull nw_protocol_options_t options, boolean use_minimum_mtu)[@function] nw_ip_options_set_use_minimum_mtu Configure IP to use the minimum MTU value, which is 1280 bytes for IPv6. This value has no effect for IPv4.- Parameters:
options- An IP protocol options object.use_minimum_mtu- A boolean indicating that the IP should use its minimum MTU value. API-Since: 12.0
-
nw_ip_options_set_disable_fragmentation
public static void nw_ip_options_set_disable_fragmentation(@NotNull @NotNull nw_protocol_options_t options, boolean disable_fragmentation)[@function] nw_ip_options_set_disable_fragmentation Configure IP to disable fragmentation on outgoing packets.- Parameters:
options- An IP protocol options object.disable_fragmentation- A boolean indicating that the IP should use disable fragmentation on outgoing packets. API-Since: 12.0
-
nw_ip_options_set_calculate_receive_time
public static void nw_ip_options_set_calculate_receive_time(@NotNull @NotNull nw_protocol_options_t options, boolean calculate_receive_time)[@function] nw_ip_options_set_calculate_receive_time Configure IP to calculate receive time for inbound packets.- Parameters:
options- An IP protocol options object.calculate_receive_time- A boolean indicating that the IP packets should mark their receive time in IP metadata. API-Since: 12.0
-
nw_ip_options_set_local_address_preference
public static void nw_ip_options_set_local_address_preference(@NotNull @NotNull nw_protocol_options_t options, int preference)[@function] nw_ip_options_set_local_address_preference Specify a preference for how to select local addresses for outbound connections.- Parameters:
options- An IP protocol options object.preference- Preference for how to select local addresses. API-Since: 13.0
-
nw_ip_create_metadata
@NotNull public static @NotNull nw_protocol_metadata_t nw_ip_create_metadata()
[@function] nw_ip_create_metadata Create an instance of IP metadata that can be used to configure per-packet options when sending data on a connection.- Returns:
- Returns a retained protocol metadata object. API-Since: 12.0
-
nw_protocol_metadata_is_ip
public static boolean nw_protocol_metadata_is_ip(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_ip Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of IP.- Returns:
- Returns true if the metadata is for the default system IP, false otherwise. API-Since: 12.0
-
nw_ip_metadata_set_ecn_flag
public static void nw_ip_metadata_set_ecn_flag(@NotNull @NotNull nw_protocol_metadata_t metadata, int ecn_flag)[@function] nw_ip_metadata_set_ecn_flag Sets ECN flags on IP metadata. This will take effect if applied to any sent content.- Parameters:
metadata- An IP metadata object.ecn_flag- The ECN flag to apply to packets. API-Since: 12.0
-
nw_ip_metadata_get_ecn_flag
public static int nw_ip_metadata_get_ecn_flag(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_ip_metadata_get_ecn_flag Gets ECN flags from IP metadata. This will be set only for metadata associated with received content.- Parameters:
metadata- An IP metadata object.- Returns:
- Returns the ECN flag received from a packet. API-Since: 12.0
-
nw_ip_metadata_set_service_class
public static void nw_ip_metadata_set_service_class(@NotNull @NotNull nw_protocol_metadata_t metadata, int service_class)[@function] nw_ip_metadata_set_service_class Sets service class on IP metadata. This will not generally translate into TOS or Traffic Class bits unless the network explicitly supports it, but it will impact local queuing of packets.- Parameters:
metadata- An IP metadata object.service_class- The service class to apply to packets. API-Since: 12.0
-
nw_ip_metadata_get_service_class
public static int nw_ip_metadata_get_service_class(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_ip_metadata_get_service_class Gets service class from IP metadata. This reflects the value set using nw_ip_metadata_set_service_class. It will not be received from the network.- Parameters:
metadata- An IP metadata object.- Returns:
- Returns the service class set on a packet. API-Since: 12.0
-
nw_ip_metadata_get_receive_time
public static long nw_ip_metadata_get_receive_time(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_ip_metadata_get_receive_time Access the time at which a packet was received. This is useful for calculating precise timing for round-trip-time estimates. Same as clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW). The receive time will be 0 unless timestamps have been enabled using nw_ip_options_set_calculate_receive_time().- Parameters:
metadata- An IP metadata object.- Returns:
- Returns the time that the packet was received. API-Since: 12.0
-
nw_listener_create_with_port
@Nullable public static @Nullable nw_listener_t nw_listener_create_with_port(@NotNull @NotNull java.lang.String port, @NotNull @NotNull nw_parameters_t parameters)
[@function] nw_listener_create_with_port Creates a networking listener bound to a specified local port.- Parameters:
port- A port number as a C string, such as "443", or a service name, such as "https".parameters- The parameters to use for the listener. These include the protocols to be used for the listener.- Returns:
- Returns an allocated nw_listener_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_listener_create
@Nullable public static @Nullable nw_listener_t nw_listener_create(@NotNull @NotNull nw_parameters_t parameters)
[@function] nw_listener_create Creates a networking listener. The listener will be assigned a random port upon which to listen unless otherwise specified by the parameters.- Parameters:
parameters- The parameters to use for the listener. These include the protocols to be used for the listener.- Returns:
- Returns an allocated nw_listener_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_listener_create_with_connection
@Nullable public static @Nullable nw_listener_t nw_listener_create_with_connection(@NotNull @NotNull nw_connection_t connection, @NotNull @NotNull nw_parameters_t parameters)
[@function] nw_listener_create_with_connection Creates a networking listener based on an existing multiplexing connection. If there are multiple protocols in the connection that support listening for incoming flows, the listener will be hooked up the highest in the stack (the closest to the reading and writing of the client data).- Parameters:
connection- An existing connection that has a multiplexing protocol that supports receiving new connections.parameters- The parameters to use for the listener. The protocol stack defined in the parameters must be able to join a protocol in the connection that supports listening protocols.- Returns:
- Returns an allocated nw_listener_t object on success. Use nw_release() to deallocate. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_listener_set_queue
public static void nw_listener_set_queue(@NotNull @NotNull nw_listener_t listener, @NotNull @NotNull dispatch_queue_t queue)[@function] nw_listener_set_queue Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_listener_start().- Parameters:
listener- The listener object.queue- The client's dispatch queue. API-Since: 12.0
-
nw_listener_set_state_changed_handler
public static void nw_listener_set_state_changed_handler(@NotNull @NotNull nw_listener_t listener, @Nullable @Nullable Network.Block_nw_listener_set_state_changed_handler handler)[@function] nw_listener_set_state_changed_handler Sets the state change handler. For clients that need to perform cleanup when the connection has been cancelled, the nw_listener_state_cancelled state will be delivered last.- Parameters:
listener- The listener object.handler- The state changed handler to call when the listener state changes. Pass NULL to remove the event handler. API-Since: 12.0
-
nw_listener_set_new_connection_handler
public static void nw_listener_set_new_connection_handler(@NotNull @NotNull nw_listener_t listener, @Nullable @Nullable Network.Block_nw_listener_set_new_connection_handler handler)[@function] nw_listener_set_new_connection_handler Sets the client new connection handler. Must be called before nw_listener_start.- Parameters:
listener- The listener object.handler- The event handler to call when the listener receives a new connection. Pass NULL to remove the new connection handler. API-Since: 12.0
-
nw_listener_get_new_connection_limit
public static int nw_listener_get_new_connection_limit(@NotNull @NotNull nw_listener_t listener)[@function] nw_listener_get_new_connection_limit Gets the listener new connection limit. The default value is NW_LISTENER_INFINITE_CONNECTION_LIMIT which indicates that the listener should not limit incoming connections. If the value is not NW_LISTENER_INFINITE_CONNECTION_LIMIT, it will be decremented by 1 every time a new connection is created. When the value becomes 0, new connection handlers will no longer be invoked until nw_listener_set_new_connection_limit() is invoked with a value that is greater than 0. Incoming connections will eventually be rejected if nw_listener_set_new_connection_limit() is not called after the connection limit reaches 0.- Parameters:
listener- The listener object.- Returns:
- Returns current new connection limit API-Since: 12.0
-
nw_listener_set_new_connection_limit
public static void nw_listener_set_new_connection_limit(@NotNull @NotNull nw_listener_t listener, int new_connection_limit)[@function] nw_listener_set_new_connection_limit Sets the listener new connection limit. Use the value NW_LISTENER_INFINITE_CONNECTION_LIMIT to disable connection limits. If the value is not NW_LISTENER_INFINITE_CONNECTION_LIMIT, it will be decremented by 1 every time a new connection is created. When the value becomes 0, new connection handlers will no longer be invoked until nw_listener_set_new_connection_limit() is invoked with a value that is greater than 0. Incoming connections will eventually be rejected if nw_listener_set_new_connection_limit() is not called after the connection limit reaches 0.- Parameters:
listener- The listener object.new_connection_limit- The new connection limit. Pass NW_LISTENER_INFINITE_CONNECTION_LIMIT to disable new connection limiting. API-Since: 12.0
-
nw_listener_set_advertise_descriptor
public static void nw_listener_set_advertise_descriptor(@NotNull @NotNull nw_listener_t listener, @Nullable @Nullable nw_advertise_descriptor_t advertise_descriptor)[@function] nw_listener_set_advertise_descriptor Describes the bonjour service the listener should register. Setting the advertise descriptor more than once may be used to update the TXT record.- Parameters:
listener- The listener object.advertise_descriptor- The advertise_descriptor or NULL to prevent or remove registration of a service. API-Since: 12.0
-
nw_listener_set_advertised_endpoint_changed_handler
public static void nw_listener_set_advertised_endpoint_changed_handler(@NotNull @NotNull nw_listener_t listener, @Nullable @Nullable Network.Block_nw_listener_set_advertised_endpoint_changed_handler handler)[@function] nw_listener_set_advertised_endpoint_changed_handler Sets the client advertised endpoint changed handler. The handler will be invoked for listeners which have called nw_listener_set_advertise_descriptor().- Parameters:
listener- The listener object.handler- The event handler to call when the listener adds or removes an advertised endpoint. Pass NULL to remove the handler. API-Since: 12.0
-
nw_listener_get_port
public static char nw_listener_get_port(@NotNull @NotNull nw_listener_t listener)[@function] nw_listener_get_port Gets the local port as a number in host byte order. If the listener was created with a port of 0 (let the system assign a port), nw_listener_get_port will return 0 until the listener is in the ready state.- Parameters:
listener- The listener to get the local port of.- Returns:
- Returns a port in host byte order. API-Since: 12.0
-
nw_listener_start
public static void nw_listener_start(@NotNull @NotNull nw_listener_t listener)[@function] nw_listener_start Starts the listener, which will cause the listener to start listening for inbound connections.- Parameters:
listener- The listener object. API-Since: 12.0
-
nw_listener_cancel
public static void nw_listener_cancel(@NotNull @NotNull nw_listener_t listener)[@function] nw_listener_cancel Cancel the listener. This will de-register the listener from the system. The process of cancellation will be completed asynchronously, and the final callback event delivered to the caller will be a state update with a value of nw_listener_state_cancelled. Once this update is delivered, the caller may clean up any associated memory or objects.- Parameters:
listener- The listener object. API-Since: 12.0
-
nw_path_monitor_create
@NotNull public static @NotNull nw_path_monitor_t nw_path_monitor_create()
[@function] nw_path_monitor_create Create a default path monitor, that will allow the enumeration of all available interfaces on the system.- Returns:
- Returns an allocated nw_path_monitor_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_path_monitor_create_with_type
@NotNull public static @NotNull nw_path_monitor_t nw_path_monitor_create_with_type(int required_interface_type)
[@function] nw_path_monitor_create_with_type Create a path monitor specific to an interface type, that will allow the enumeration of any interface that matches the type on the system.- Parameters:
required_interface_type- An interface type that will filter any results that the path monitor returns.- Returns:
- Returns an allocated nw_path_monitor_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 12.0
-
nw_path_monitor_set_cancel_handler
public static void nw_path_monitor_set_cancel_handler(@NotNull @NotNull nw_path_monitor_t monitor, @NotNull @NotNull Network.Block_nw_path_monitor_set_cancel_handler cancel_handler)[@function] nw_path_monitor_set_cancel_handler Set a handler to be called on the queue provided to nw_path_monitor_set_queue once cancellation has completed. Once the cancel handler has been called, the update handler will not fire again.- Parameters:
monitor- The path monitor object.cancel_handler- The block to call upon cancellation. Pass NULL to remove the cancel handler. API-Since: 12.0
-
nw_path_monitor_set_update_handler
public static void nw_path_monitor_set_update_handler(@NotNull @NotNull nw_path_monitor_t monitor, @NotNull @NotNull Network.Block_nw_path_monitor_set_update_handler update_handler)[@function] nw_path_monitor_set_update_handler Sets the client update handler. This block will be called with the current path when start is called and any time the path changes.- Parameters:
monitor- The path monitor object.update_handler- The block to call when the path changes. API-Since: 12.0
-
nw_path_monitor_set_queue
public static void nw_path_monitor_set_queue(@NotNull @NotNull nw_path_monitor_t monitor, @NotNull @NotNull dispatch_queue_t queue)[@function] nw_path_monitor_set_queue Sets the client update queue. All blocks will be scheduled on this queue. Call before calling nw_path_monitor_start.- Parameters:
monitor- The path monitor object.queue- The dispatch queue on which to call the update and cancel handlers. API-Since: 12.0
-
nw_path_monitor_start
public static void nw_path_monitor_start(@NotNull @NotNull nw_path_monitor_t monitor)[@function] nw_path_monitor_start Starts the path monitor.- Parameters:
monitor- The path monitor object. API-Since: 12.0
-
nw_path_monitor_cancel
public static void nw_path_monitor_cancel(@NotNull @NotNull nw_path_monitor_t monitor)[@function] nw_path_monitor_cancel Cancel the path monitor.- Parameters:
monitor- The path monitor object. API-Since: 12.0
-
nw_protocol_copy_tcp_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_copy_tcp_definition()
[@function] nw_protocol_copy_tcp_definition Access the definition of the default system protocol implementation of TCP (Transmission Control Protocol). This protocol can be used as part of a connection's protocol stack as the transport protocol.- Returns:
- Returns a retained protocol definition object. API-Since: 12.0
-
nw_tcp_create_options
@NotNull public static @NotNull nw_protocol_options_t nw_tcp_create_options()
[@function] nw_tcp_create_options Create an instance of TCP protocol options. This object can be added to an nw_protocol_stack_t to be used in an nw_connection_t or an nw_listener_t.- Returns:
- Returns a retained protocol options object. API-Since: 12.0
-
nw_tcp_options_set_no_delay
public static void nw_tcp_options_set_no_delay(@NotNull @NotNull nw_protocol_options_t options, boolean no_delay)[@function] nw_tcp_options_set_no_delay Configure TCP to disable Nagle's algorithm, which will delay sending packets to coalesce sending.- Parameters:
options- A TCP protocol options object.no_delay- A boolean indicating that TCP should disable Nagle's algorithm. API-Since: 12.0
-
nw_tcp_options_set_no_push
public static void nw_tcp_options_set_no_push(@NotNull @NotNull nw_protocol_options_t options, boolean no_push)[@function] nw_tcp_options_set_no_push Wait to send TCP data until the connection has finished writing, or else the TCP send buffer is full.- Parameters:
options- A TCP protocol options object.no_push- A boolean indicating that TCP should be set into no-push mode. API-Since: 12.0
-
nw_tcp_options_set_no_options
public static void nw_tcp_options_set_no_options(@NotNull @NotNull nw_protocol_options_t options, boolean no_options)[@function] nw_tcp_options_set_no_options Disable sending TCP options and extensions.- Parameters:
options- A TCP protocol options object.no_options- A boolean indicating that TCP should be set into no-options mode. API-Since: 12.0
-
nw_tcp_options_set_enable_keepalive
public static void nw_tcp_options_set_enable_keepalive(@NotNull @NotNull nw_protocol_options_t options, boolean enable_keepalive)[@function] nw_tcp_options_set_enable_keepalive Enable sending TCP keepalive probes.- Parameters:
options- A TCP protocol options object.enable_keepalive- A boolean indicating that TCP should send keepalives. API-Since: 12.0
-
nw_tcp_options_set_keepalive_count
public static void nw_tcp_options_set_keepalive_count(@NotNull @NotNull nw_protocol_options_t options, int keepalive_count)[@function] nw_tcp_options_set_keepalive_count Configure the number of times TCP keepalive probes should be sent without reply before terminating the connection.- Parameters:
options- A TCP protocol options object.keepalive_count- The number of keepalive probes to send before terminating the connection. API-Since: 12.0
-
nw_tcp_options_set_keepalive_idle_time
public static void nw_tcp_options_set_keepalive_idle_time(@NotNull @NotNull nw_protocol_options_t options, int keepalive_idle_time)[@function] nw_tcp_options_set_keepalive_idle_time Configure the amount of time that a connection must be idle before TCP should start sending keepalive probes.- Parameters:
options- A TCP protocol options object.keepalive_idle_time- The number of seconds of idleness to wait before keepalive probes are sent by TCP. API-Since: 12.0
-
nw_tcp_options_set_keepalive_interval
public static void nw_tcp_options_set_keepalive_interval(@NotNull @NotNull nw_protocol_options_t options, int keepalive_interval)[@function] nw_tcp_options_set_keepalive_interval Configure the amount of time between sending TCP keepalive probes when the peer is not responding.- Parameters:
options- A TCP protocol options object.keepalive_interval- The number of seconds of to wait before resending TCP keepalive probes. API-Since: 12.0
-
nw_tcp_options_set_maximum_segment_size
public static void nw_tcp_options_set_maximum_segment_size(@NotNull @NotNull nw_protocol_options_t options, int maximum_segment_size)[@function] nw_tcp_options_set_maximum_segment_size Directly configure the maximum segment size (MSS) TCP will use.- Parameters:
options- A TCP protocol options object.maximum_segment_size- The maximum segment size in bytes. API-Since: 12.0
-
nw_tcp_options_set_connection_timeout
public static void nw_tcp_options_set_connection_timeout(@NotNull @NotNull nw_protocol_options_t options, int connection_timeout)[@function] nw_tcp_options_set_connection_timeout Define a timeout value after which TCP connection establishment will give up.- Parameters:
options- A TCP protocol options object.connection_timeout- A timeout for TCP connection establishment, in seconds. API-Since: 12.0
-
nw_tcp_options_set_persist_timeout
public static void nw_tcp_options_set_persist_timeout(@NotNull @NotNull nw_protocol_options_t options, int persist_timeout)[@function] nw_tcp_options_set_persist_timeout Define a timeout value after which TCP connections in the persist state will terminate. See RFC 6429.- Parameters:
options- A TCP protocol options object.persist_timeout- The TCP persist timeout, in seconds. API-Since: 12.0
-
nw_tcp_options_set_retransmit_connection_drop_time
public static void nw_tcp_options_set_retransmit_connection_drop_time(@NotNull @NotNull nw_protocol_options_t options, int retransmit_connection_drop_time)[@function] nw_tcp_options_set_retransmit_connection_drop_time Define a timeout value after which TCP will drop a connection with unacknowledged retransmissions.- Parameters:
options- A TCP protocol options object.retransmit_connection_drop_time- A timeout for TCP retransmission attempts, in seconds. API-Since: 12.0
-
nw_tcp_options_set_retransmit_fin_drop
public static void nw_tcp_options_set_retransmit_fin_drop(@NotNull @NotNull nw_protocol_options_t options, boolean retransmit_fin_drop)[@function] nw_tcp_options_set_retransmit_fin_drop Cause TCP to drop connections after not receiving an ACK multiple times after a FIN, currently set at three.- Parameters:
options- A TCP protocol options object.retransmit_fin_drop- A boolean to cause TCP to drop its connection after not receiving an ACK after a FIN. API-Since: 12.0
-
nw_tcp_options_set_disable_ack_stretching
public static void nw_tcp_options_set_disable_ack_stretching(@NotNull @NotNull nw_protocol_options_t options, boolean disable_ack_stretching)[@function] nw_tcp_options_set_disable_ack_stretching Configure TCP to disable ACK stretching. ACKs will be sent for every other data packet.- Parameters:
options- A TCP protocol options object.disable_ack_stretching- A boolean to cause TCP to disable ACK stretching. API-Since: 12.0
-
nw_tcp_options_set_enable_fast_open
public static void nw_tcp_options_set_enable_fast_open(@NotNull @NotNull nw_protocol_options_t options, boolean enable_fast_open)[@function] nw_tcp_options_set_enable_fast_open Configure TCP to enable TCP Fast Open (TFO). This may take effect even when TCP is not the top-level protocol in the protocol stack. For example, if TLS is running over TCP, the Client Hello message may be sent as fast open data. If TCP is the top-level protocol in the stack (the one the application directly interacts with), TFO will be disabled unless the application indicated that it will provide its own fast open data by calling nw_parameters_set_fast_open_enabled().- Parameters:
options- A TCP protocol options object.enable_fast_open- A boolean to enable TFO. API-Since: 12.0
-
nw_tcp_options_set_disable_ecn
public static void nw_tcp_options_set_disable_ecn(@NotNull @NotNull nw_protocol_options_t options, boolean disable_ecn)[@function] nw_tcp_options_set_disable_ecn Configure TCP to disable default Explicit Congestion Notification (ECN) behavior.- Parameters:
options- A TCP protocol options object.disable_ecn- A boolean to disable ECN support in TCP. API-Since: 12.0
-
nw_protocol_metadata_is_tcp
public static boolean nw_protocol_metadata_is_tcp(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_tcp Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of TCP.- Returns:
- Returns true if the metadata is for the default system TCP, false otherwise. API-Since: 12.0
-
nw_tcp_get_available_receive_buffer
public static int nw_tcp_get_available_receive_buffer(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_tcp_get_available_receive_buffer Fetch the number of bytes waiting to be read from the receive buffer.- Returns:
- The number of bytes available in the receive buffer. API-Since: 12.0
-
nw_tcp_get_available_send_buffer
public static int nw_tcp_get_available_send_buffer(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_tcp_get_available_send_buffer Fetch the number of bytes waiting to be acknowledged in the send buffer.- Returns:
- The number of bytes waiting to be acknowledged. API-Since: 12.0
-
nw_protocol_copy_tls_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_copy_tls_definition()
[@function] nw_protocol_copy_tls_definition Access the definition of the default system protocol implementation of TLS (Transport Layer Security). This protocol can be used as part of a connection's protocol stack as an application protocol.- Returns:
- Returns a retained protocol definition object. API-Since: 12.0
-
nw_tls_create_options
@NotNull public static @NotNull nw_protocol_options_t nw_tls_create_options()
[@function] nw_tls_create_options Create an instance of TLS protocol options. This object can be added to an nw_protocol_stack_t to be used in an nw_connection_t or an nw_listener_t.- Returns:
- Returns a retained protocol options object. API-Since: 12.0
-
nw_tls_copy_sec_protocol_options
@NotNull public static @NotNull sec_protocol_options_t nw_tls_copy_sec_protocol_options(@NotNull @NotNull nw_protocol_options_t options)
[@function] nw_tls_copy_sec_protocol_options Access the sec_protocol_options_t for a given network protocol options instance. Seefor functions to further configure security options. - Parameters:
options- An nw_protocol_options_t that has been created for TLS.- Returns:
- Returns a retained sec_protocol_options_t object. API-Since: 12.0
-
nw_protocol_metadata_is_tls
public static boolean nw_protocol_metadata_is_tls(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_tls Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of TLS.- Returns:
- Returns true if the metadata is for the default system TLS, false otherwise. API-Since: 12.0
-
nw_tls_copy_sec_protocol_metadata
@NotNull public static @NotNull sec_protocol_metadata_t nw_tls_copy_sec_protocol_metadata(@NotNull @NotNull nw_protocol_metadata_t metadata)
[@function] nw_tls_copy_sec_protocol_metadata Access the sec_protocol_metadata_t for a given network protocol metadata instance. Seefor functions to access security properties. - Parameters:
metadata- An nw_protocol_metadata_t for the TLS protocol.- Returns:
- Returns a retained sec_protocol_metadata_t object. API-Since: 12.0
-
nw_protocol_copy_udp_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_copy_udp_definition()
[@function] nw_protocol_copy_udp_definition Access the definition of the default system protocol implementation of UDP (User Datagram Protocol). This protocol can be used as part of a connection's protocol stack as the transport protocol.- Returns:
- Returns a retained protocol definition object. API-Since: 12.0
-
nw_udp_create_options
@NotNull public static @NotNull nw_protocol_options_t nw_udp_create_options()
[@function] nw_udp_create_options Create an instance of UDP protocol options. This object can be added to an nw_protocol_stack_t to be used in an nw_connection_t or an nw_listener_t.- Returns:
- Returns a retained protocol options object. API-Since: 12.0
-
nw_udp_options_set_prefer_no_checksum
public static void nw_udp_options_set_prefer_no_checksum(@NotNull @NotNull nw_protocol_options_t options, boolean prefer_no_checksum)[@function] nw_udp_options_set_prefer_no_checksum Configure UDP to skip computing checksums when sending. This will only take effect when running over IPv4.- Parameters:
options- A UDP protocol options object.prefer_no_checksum- A boolean that indicates if UDP is allowed to skip computing its checksum. API-Since: 12.0
-
nw_udp_create_metadata
@NotNull public static @NotNull nw_protocol_metadata_t nw_udp_create_metadata()
[@function] nw_udp_create_metadata Create an instance of UDP metadata that can be used to configure per-datagram options when sending data on a connection.- Returns:
- Returns a retained protocol metadata object. API-Since: 12.0
-
nw_protocol_metadata_is_udp
public static boolean nw_protocol_metadata_is_udp(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_udp Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of UDP.- Returns:
- Returns true if the metadata is for the default system UDP, false otherwise. API-Since: 12.0
-
nw_protocol_copy_ws_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_copy_ws_definition()
[@function] nw_protocol_copy_ws_definition Access the definition of the default system implementation of the WebSocket protocol. This protocol can be appended to a connection's protocol stack.- Returns:
- Returns a retained protocol definition object. API-Since: 13.0
-
nw_ws_create_options
@NotNull public static @NotNull nw_protocol_options_t nw_ws_create_options(int version)
[@function] nw_ws_create_options Create an instance of WebSocket protocol options. This object can be added to an nw_protocol_stack_t to be used in an nw_connection_t or an nw_listener_t.- Returns:
- Returns a retained protocol options object. API-Since: 13.0
-
nw_ws_options_add_additional_header
public static void nw_ws_options_add_additional_header(@NotNull @NotNull nw_protocol_options_t options, @NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String value)[@function] nw_ws_options_add_additional_header Set additional HTTP headers to be sent by the client during the WebSocket handshake.- Parameters:
options- The WebSocket protocol options object.name- The HTTP header name.value- The HTTP header value. API-Since: 13.0
-
nw_ws_options_add_subprotocol
public static void nw_ws_options_add_subprotocol(@NotNull @NotNull nw_protocol_options_t options, @NotNull @NotNull java.lang.String subprotocol)[@function] nw_ws_options_add_subprotocol Add to the list of subprotocols that will be presented to a WebSocket server during connection establishment.- Parameters:
options- The WebSocket protocol options object.subprotocol- The subprotocol supported by the client. API-Since: 13.0
-
nw_ws_options_set_auto_reply_ping
public static void nw_ws_options_set_auto_reply_ping(@NotNull @NotNull nw_protocol_options_t options, boolean auto_reply_ping)[@function] nw_ws_options_set_auto_reply_ping Set whether the WebSocket connection should automatically reply to all incoming pings. If set to true, the WebSocket protocol will automatically reply to incoming pings and will deliver the pings to receive requests on the connection.- Parameters:
options- The WebSocket protocol options object.auto_reply_ping- Whether the WebSocket connection should automatically reply to all incoming pings. API-Since: 13.0
-
nw_ws_options_set_skip_handshake
public static void nw_ws_options_set_skip_handshake(@NotNull @NotNull nw_protocol_options_t options, boolean skip_handshake)[@function] nw_ws_options_set_skip_handshake Set whether the WebSocket protocol should skip the opening handshake and begin framing data as soon as a connection is established.- Parameters:
options- The WebSocket protocol options object.skip_handshake- Whether the WebSocket connection should skip the opening handshake. API-Since: 13.0
-
nw_ws_options_set_maximum_message_size
public static void nw_ws_options_set_maximum_message_size(@NotNull @NotNull nw_protocol_options_t options, long maximum_message_size)[@function] nw_ws_options_set_maximum_message_size Set the maximum allowed message size to be received by the WebSocket connection. This does not limit the sending message size.- Parameters:
options- The WebSocket protocol options object.maximum_message_size- The maximum message size in bytes. A maximum message size of 0 means there is no receive limit. The default maximum message size is 0. API-Since: 13.0
-
nw_protocol_metadata_is_ws
public static boolean nw_protocol_metadata_is_ws(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_ws Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of WebSocket.- Returns:
- Returns true if the metadata is for the default system implementation of WebSocket, false otherwise. API-Since: 13.0
-
nw_ws_create_metadata
@NotNull public static @NotNull nw_protocol_metadata_t nw_ws_create_metadata(int opcode)
[@function] nw_ws_create_metadata Creates a protocol metadata object that can be used to define the content context of messages sent over a WebSocket connection.- Parameters:
opcode- Set the opcode on a WebSocket frame. This must be defined on create.- Returns:
- Returns a retained metadata object representing the WebSocket frame. API-Since: 13.0
-
nw_ws_metadata_get_opcode
public static int nw_ws_metadata_get_opcode(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_ws_metadata_get_opcode Get the opcode on a WebSocket frame.- Parameters:
metadata- The metadata object representing the WebSocket frame.- Returns:
- The opcode on the WebSocket frame. API-Since: 13.0
-
nw_ws_metadata_set_close_code
public static void nw_ws_metadata_set_close_code(@NotNull @NotNull nw_protocol_metadata_t metadata, int close_code)[@function] nw_ws_metadata_set_close_code Set the close code on a WebSocket frame. The WebSocket frame's opcode should be nw_ws_opcode_close.- Parameters:
metadata- The metadata object representing the WebSocket frame.close_code- The close code on the WebSocket frame. API-Since: 13.0
-
nw_ws_metadata_get_close_code
public static int nw_ws_metadata_get_close_code(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_ws_metadata_get_close_code Get the close code from a WebSocket frame. If the close code is equal to nw_ws_close_code_no_status_received, it means that a close code was not actually present in the WebSocket frame.- Parameters:
metadata- The metadata object representing the WebSocket frame.- Returns:
- The close code on the WebSocket frame. API-Since: 13.0
-
nw_ws_metadata_set_pong_handler
public static void nw_ws_metadata_set_pong_handler(@NotNull @NotNull nw_protocol_metadata_t metadata, @NotNull @NotNull dispatch_queue_t client_queue, @NotNull @NotNull Network.Block_nw_ws_metadata_set_pong_handler pong_handler)[@function] nw_ws_metadata_set_pong_handler Set a callback that will notify the client when a pong message has been received for a ping message sent. The metadata object's associated opcode should be nw_ws_opcode_ping.- Parameters:
metadata- The WebSocket metadata object.client_queue- The queue on which the pong handler will be delivered.pong_handler- The handler that gets called when a pong reply is received. API-Since: 13.0
-
nw_ws_request_enumerate_subprotocols
public static boolean nw_ws_request_enumerate_subprotocols(@NotNull @NotNull nw_ws_request_t request, @NotNull @NotNull Network.Block_nw_ws_request_enumerate_subprotocols enumerator)[@function] nw_ws_request_enumerate_subprotocols Enumerates the list of subprotocols on the client's request.- Parameters:
request- The client request.enumerator- The enumerator block.- Returns:
- Whether the enumeration completed. API-Since: 13.0
-
nw_ws_request_enumerate_additional_headers
public static boolean nw_ws_request_enumerate_additional_headers(@NotNull @NotNull nw_ws_request_t request, @NotNull @NotNull Network.Block_nw_ws_request_enumerate_additional_headers enumerator)[@function] nw_ws_request_enumerate_additional_headers Enumerates the list of additional headers on the client's request.- Parameters:
request- The client request.enumerator- The enumerator block.- Returns:
- Whether the enumeration completed. API-Since: 13.0
-
nw_ws_response_create
@NotNull public static @NotNull nw_ws_response_t nw_ws_response_create(int status, @Nullable @Nullable java.lang.String selected_subprotocol)
[@function] nw_ws_response_create Create a server response to a WebSocket client's opening handshake.- Parameters:
status- The status of the response. If the status is nw_ws_response_status_accept, the server will accept the handshake and open the WebSocket connection. If the status is nw_ws_response_status_reject, the server will reject the handshake and respond with the HTTP error 400 Bad Request.selected_subprotocol- The server's selected protocol from the client's list of proposed subprotocols. If the status of this response is nw_ws_response_status_reject, this parameter is ignored. Pass NULL to indicate the server did not find a suitable subprotocol, but has accepted the handshake anyways. Passing an empty string is prohibited by the WebSocket protocol.- Returns:
- An instantiated WebSocket server response object. API-Since: 13.0
-
nw_ws_response_get_status
public static int nw_ws_response_get_status(@Nullable @Nullable nw_ws_response_t response)[@function] nw_ws_response_get_status Get the status from a WebSocket server's response. If the response is nil, the return value will be nw_ws_response_status_invalid.- Parameters:
response- The server response.- Returns:
- The status of the server's response. API-Since: 13.0
-
nw_ws_response_get_selected_subprotocol
@Nullable public static @Nullable java.lang.String nw_ws_response_get_selected_subprotocol(@NotNull @NotNull nw_ws_response_t response)[@function] nw_ws_response_get_selected_subprotocol Get the selected subprotocol from a WebSocket server's response.- Parameters:
response- The server response.- Returns:
- The status of the server's response. API-Since: 13.0
-
nw_ws_response_add_additional_header
public static void nw_ws_response_add_additional_header(@NotNull @NotNull nw_ws_response_t response, @NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String value)[@function] nw_ws_response_add_additional_header Add additional HTTP headers to be sent back to the WebSocket client in the server's response.- Parameters:
response- The server response.name- The HTTP name.value- The HTTP value. API-Since: 13.0
-
nw_ws_metadata_copy_server_response
@NotNull public static @NotNull nw_ws_response_t nw_ws_metadata_copy_server_response(@NotNull @NotNull nw_protocol_metadata_t metadata)
[@function] nw_ws_metadata_copy_server_response Copy the WebSocket server's response to a client's request to connect. If this is called on a WebSocket server, the response object will contain the server's own response to the client.- Parameters:
metadata- The metadata object representing the WebSocket connection.- Returns:
- The server response. API-Since: 13.0
-
nw_ws_response_enumerate_additional_headers
public static boolean nw_ws_response_enumerate_additional_headers(@NotNull @NotNull nw_ws_response_t response, @NotNull @NotNull Network.Block_nw_ws_response_enumerate_additional_headers enumerator)[@function] nw_ws_response_enumerate_additional_headers Enumerates the list of additional headers on the server's response.- Parameters:
response- The server response.enumerator- The enumerator block.- Returns:
- Whether the enumeration completed. API-Since: 13.0
-
nw_ws_options_set_client_request_handler
public static void nw_ws_options_set_client_request_handler(@NotNull @NotNull nw_protocol_options_t options, @NotNull @NotNull dispatch_queue_t client_queue, @NotNull @NotNull Network.Block_nw_ws_options_set_client_request_handler handler)[@typedef] nw_ws_options_set_client_request_handler Set callback handler to be invoked when a WebSocket server receives a WebSocket client's request to connect.- Parameters:
options- The protocol options object.client_queue- The queue on which the client request handler will be delivered.handler- The callback handler. API-Since: 13.0
-
kNWErrorDomainPOSIX
@NotNull public static @NotNull CFStringRef kNWErrorDomainPOSIX()
Values will be POSIX errors API-Since: 12.0
-
kNWErrorDomainDNS
@NotNull public static @NotNull CFStringRef kNWErrorDomainDNS()
Values will be DNSServiceErrorType errors API-Since: 12.0
-
kNWErrorDomainTLS
@NotNull public static @NotNull CFStringRef kNWErrorDomainTLS()
Values will be errSSL* errors API-Since: 12.0
-
_nw_content_context_default_message
@NotNull public static @NotNull nw_content_context_t _nw_content_context_default_message()
API-Since: 12.0
-
_nw_content_context_final_send
@NotNull public static @NotNull nw_content_context_t _nw_content_context_final_send()
API-Since: 12.0
-
_nw_content_context_default_stream
@NotNull public static @NotNull nw_content_context_t _nw_content_context_default_stream()
API-Since: 12.0
-
_nw_data_transfer_report_all_paths
public static int _nw_data_transfer_report_all_paths()
[@const] NW_ALL_PATHS Pass NW_ALL_PATHS to data transfer report accessors to sum values across paths where applicable. For values that cannot sum, the value of the primary path is used. API-Since: 13.0
-
nw_resolver_config_create_https
@NotNull public static @NotNull nw_resolver_config_t nw_resolver_config_create_https(@NotNull @NotNull nw_endpoint_t url_endpoint)
[@function] nw_resolver_config_create_https Creates a DNS-over-HTTPS (DoH) resolver configuration. The provided URL describes the location of the DNS server, such as "https://dnsserver.example.net/dns-query". See RFC 8484.- Parameters:
url_endpoint- The URL template of the DoH server as an endpoint.- Returns:
- Returns an allocated nw_resolver_config_t object on success. API-Since: 14.0
-
nw_resolver_config_create_tls
@NotNull public static @NotNull nw_resolver_config_t nw_resolver_config_create_tls(@NotNull @NotNull nw_endpoint_t server_endpoint)
[@function] nw_resolver_config_create_tls Creates a DNS-over-TLS (DoT) resolver configuration. The hostname of the provided endpoint will be used to validate the TLS certificate of the server. See RFC 7858.- Parameters:
server_endpoint- A host endpoint identifying the DoT server.- Returns:
- Returns an allocated nw_resolver_config_t object on success. API-Since: 14.0
-
nw_resolver_config_add_server_address
public static void nw_resolver_config_add_server_address(@NotNull @NotNull nw_resolver_config_t config, @NotNull @NotNull nw_endpoint_t server_address)[@function] nw_resolver_config_add_name_server Modifies the resolver configuration by adding a DNS server address as an endpoint.- Parameters:
config- A resolver config object.server_address- A server address to assign to the configuration, as an endpoint. API-Since: 14.0
-
nw_privacy_context_create
@NotNull public static @NotNull nw_privacy_context_t nw_privacy_context_create(@NotNull @NotNull java.lang.String description)
[@function] nw_privacy_context_create Create a new privacy context. This object can be added to connections and listeners by setting the privacy context on the nw_parameters_t. Each privacy context can have unique settings for logging and resolution, and implicitly has an isolated cache for items like TLS sessions.- Parameters:
description- A string description used for logging.- Returns:
- Returns an allocated nw_privacy_context_t object on success. API-Since: 14.0
-
nw_privacy_context_flush_cache
public static void nw_privacy_context_flush_cache(@NotNull @NotNull nw_privacy_context_t privacy_context)[@function] nw_privacy_context_flush_cache Flush any cached state stored in this privacy context. The act of flushing the cache may be asynchronous, which means that it will take effect shortly after the function is invoked.- Parameters:
privacy_context- A privacy context to flush. API-Since: 14.0
-
nw_privacy_context_disable_logging
public static void nw_privacy_context_disable_logging(@NotNull @NotNull nw_privacy_context_t privacy_context)[@function] nw_privacy_context_disable_logging Disable logging for connections and listeners associated with this context. Logging may not be disabled on the default privacy context.- Parameters:
privacy_context- A privacy context on which to disable logging. API-Since: 14.0
-
nw_privacy_context_require_encrypted_name_resolution
public static void nw_privacy_context_require_encrypted_name_resolution(@NotNull @NotNull nw_privacy_context_t privacy_context, boolean require_encrypted_name_resolution, @Nullable @Nullable nw_resolver_config_t fallback_resolver_config)[@function] nw_privacy_context_require_encrypted_name_resolution Require that any DNS name resolution occurring for connections associated with this context use encrypted transports, such as TLS or HTTPS. Any unencrypted queries will be blocked if require_encrypted_name_resolution is set to true. Optionally, a fallback resolver config can be provided to use instead of blocking queries when require_encrypted_name_resolution is set to true.- Parameters:
privacy_context- A privacy context to modify. This can include the default privacy context.require_encrypted_name_resolution- If true, require that any name resolution using DNS is performed with encryption. If false, allow cleartext resolution. Defaults to false.fallback_resolver_config- An optional resolver configuration to use if no other encrypted DNS resolver is already configured for the query. This will only take effect if require_encrypted_name_resolution is set to true. If this configuration is NULL and require_encrypted_name_resolution is set to true, all cleartext name resolution will be blocked. API-Since: 14.0
-
nw_parameters_set_privacy_context
public static void nw_parameters_set_privacy_context(@NotNull @NotNull nw_parameters_t parameters, @NotNull @NotNull nw_privacy_context_t privacy_context)[@function] nw_parameters_set_privacy_context Set a privacy context on the parameters, which will be associated with connections and listeners. The privacy context allows using separate caches for different sets of connections, as well as restricting how connection-specific information is logged and shared on the network.- Parameters:
parameters- The parameters object to configureprivacy_context- The privacy context to associate with connections and listeners that use these parameters. API-Since: 14.0
-
nw_group_descriptor_create_multicast
@NotNull public static @NotNull nw_group_descriptor_t nw_group_descriptor_create_multicast(@NotNull @NotNull nw_endpoint_t multicast_group)
[@function] nw_group_descriptor_create_multicast Creates a new group descriptor object based on a multicast group, represented as an address endpoint.- Parameters:
multicast_group- An address endpoint that contains a multicast group to join.- Returns:
- An instantiated group descriptor object or nil if the specified endpoint is not an address endpoint representing a valid multicast group. API-Since: 14.0
-
nw_group_descriptor_add_endpoint
public static boolean nw_group_descriptor_add_endpoint(@NotNull @NotNull nw_group_descriptor_t descriptor, @NotNull @NotNull nw_endpoint_t endpoint)[@function] nw_group_descriptor_add_endpoint Add an additional endpoint to a given group descriptor.- Parameters:
descriptor- A group descriptor.endpoint- An endpoint to add to the group.- Returns:
- Returns true if the endpoint was added, false if the endpoint was not of a valid type and therefore not added. API-Since: 14.0
-
nw_group_descriptor_enumerate_endpoints
public static void nw_group_descriptor_enumerate_endpoints(@NotNull @NotNull nw_group_descriptor_t descriptor, @NotNull @NotNull Network.Block_nw_group_descriptor_enumerate_endpoints enumerate_block)[@function] nw_group_descriptor_enumerate_endpoints List all endpoints associated with the group descriptor.- Parameters:
descriptor- The group descriptor object to check.enumerate_block- A block to which the endpoints associated with the descriptor will be passed. Returning true from the block will continue to enumerate, and returning false will stop enumerating. API-Since: 14.0
-
nw_multicast_group_descriptor_set_specific_source
public static void nw_multicast_group_descriptor_set_specific_source(@NotNull @NotNull nw_group_descriptor_t multicast_descriptor, @NotNull @NotNull nw_endpoint_t source)[@function] nw_multicast_group_descriptor_set_specific_source Require a particular source for this multicast group descriptor.- Parameters:
multicast_descriptor- The multicast group descriptor to modify.source- An endpoint describing the source for this descriptor. API-Since: 14.0
-
nw_multicast_group_descriptor_set_disable_unicast_traffic
public static void nw_multicast_group_descriptor_set_disable_unicast_traffic(@NotNull @NotNull nw_group_descriptor_t multicast_descriptor, boolean disable_unicast_traffic)[@function] nw_multicast_group_descriptor_set_disable_unicast_traffic Disable receiving unicast traffic for a connection group that is also receiving multicast traffic.- Parameters:
multicast_descriptor- The multicast group descriptor to modify.disable_unicast_traffic- A boolean indicating if receiving unicast traffic should be disabled. API-Since: 14.0
-
nw_multicast_group_descriptor_get_disable_unicast_traffic
public static boolean nw_multicast_group_descriptor_get_disable_unicast_traffic(@NotNull @NotNull nw_group_descriptor_t multicast_descriptor)[@function] nw_multicast_group_descriptor_get_disable_unicast_traffic Check if receiving unicast traffic has been disabled for a multicast connection group.- Parameters:
multicast_descriptor- The multicast group descriptor to check.- Returns:
- A boolean indicating if receiving unicast traffic should be disabled. API-Since: 14.0
-
nw_connection_group_create
@NotNull public static @NotNull nw_connection_group_t nw_connection_group_create(@NotNull @NotNull nw_group_descriptor_t group_descriptor, @NotNull @NotNull nw_parameters_t parameters)
[@function] nw_connection_group_create Creates a new connection group object to use for communication with a group descriptor using protocols described by parameters.- Parameters:
group_descriptor- A group descriptor. For example, a descriptor of type nw_group_type_multicast defines one or more multicast groups to automatically join.parameters- Parameters to use for the new connection group. This includes the protocols that will be used to delineate complete messages for processing. For multicast joining, all available interfaces will be joined as prohibited or required.- Returns:
- Returns an allocated nw_connection_group_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 14.0
-
nw_connection_group_copy_descriptor
@NotNull public static @NotNull nw_group_descriptor_t nw_connection_group_copy_descriptor(@NotNull @NotNull nw_connection_group_t group)
[@function] nw_connection_group_copy_descriptor Gets the group descriptor with which the connection group was created.- Parameters:
group- The connection group to check.- Returns:
- Returns the descriptor with which the connection group was created. API-Since: 14.0
-
nw_connection_group_copy_parameters
@NotNull public static @NotNull nw_parameters_t nw_connection_group_copy_parameters(@NotNull @NotNull nw_connection_group_t group)
[@function] nw_connection_group_copy_parameters Returns a copy of the parameters passed to nw_connection_group_create.- Parameters:
group- The connection group object.- Returns:
- Returns an nw_parameters_t object. API-Since: 14.0
-
nw_connection_group_set_queue
public static void nw_connection_group_set_queue(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull dispatch_queue_t queue)[@function] nw_connection_group_set_queue Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_connection_group_start().- Parameters:
group- The connection group object.queue- The client's callback queue. API-Since: 14.0
-
nw_connection_group_set_state_changed_handler
public static void nw_connection_group_set_state_changed_handler(@NotNull @NotNull nw_connection_group_t group, @Nullable @Nullable Network.Block_nw_connection_group_set_state_changed_handler state_changed_handler)[@function] nw_connection_group_set_state_changed_handler Sets the state changed handler. For clients that need to perform cleanup when the connection group has been cancelled, the nw_connection_group_state_cancelled state will be delivered last. This function must not be called after starting the connection group.- Parameters:
group- The connection group object.state_changed_handler- The state changed handler to call when the connection group state changes. Pass NULL to remove the event handler. API-Since: 14.0
-
nw_connection_group_set_receive_handler
public static void nw_connection_group_set_receive_handler(@NotNull @NotNull nw_connection_group_t group, int maximum_message_size, boolean reject_oversized_messages, @Nullable @Nullable Network.Block_nw_connection_group_set_receive_handler receive_handler)[@function] nw_connection_group_set_receive_handler Sets the handler to be invoked whenever a new inbound message arrives at the connection group. This function must not be called after starting the connection group.- Parameters:
group- The connection group object.maximum_message_size- The maximum message size that should be delivered as a complete message. Any inbound messages larger than this size will be delivered as a partial message and an application may convert the inbound message to an `nw_connection` to read any remaining data for that message until it is complete.reject_oversized_messages- True if messages larger than maximum_message_size should be treated as errors and the connection group should automatically reply to such messages. False if the connection group should deliver such messages as incomplete and allow the application to inspect the message prior to accepting or rejecting it.receive_handler- The handler to call upon arrival of a new inbound message. Pass NULL to remove the handler. API-Since: 14.0
-
nw_connection_group_start
public static void nw_connection_group_start(@NotNull @NotNull nw_connection_group_t group)[@function] nw_connection_group_start Starts the connection group, which begins listening for and processing incoming messages. You must call nw_connection_group_set_queue() and set a receive handler with nw_connection_group_set_receive_handler() before starting the connection group.- Parameters:
group- The connection group object. API-Since: 14.0
-
nw_connection_group_cancel
public static void nw_connection_group_cancel(@NotNull @NotNull nw_connection_group_t group)[@function] nw_connection_group_cancel Cancels the connection group. The process of cancellation will be completed asynchronously, and the final callback event delivered to the caller will be a state update with a value of nw_connection_group_state_cancelled. Once this update is delivered, the caller may clean up any associated memory or objects.- Parameters:
group- The connection group object. API-Since: 14.0
-
nw_connection_group_copy_remote_endpoint_for_message
@Nullable public static @Nullable nw_endpoint_t nw_connection_group_copy_remote_endpoint_for_message(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_content_context_t context)
[@function] nw_connection_group_copy_remote_endpoint_for_message Copy the remote endpoint corresponding to a given inbound connection group message.- Parameters:
group- The connection group object.context- A content context representing an inbound message received from this connection group.- Returns:
- Returns the remote endpoint, or nil if the context is not a valid inbound message received from this connection group. API-Since: 14.0
-
nw_connection_group_copy_local_endpoint_for_message
@Nullable public static @Nullable nw_endpoint_t nw_connection_group_copy_local_endpoint_for_message(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_content_context_t context)
[@function] nw_connection_group_copy_local_endpoint_for_message Copy the local endpoint corresponding to a given inbound connection group message.- Parameters:
group- The connection group object.context- A content context representing an inbound message received from this connection group.- Returns:
- Returns the local endpoint, or nil if the context is not a valid inbound message received from this connection group. API-Since: 14.0
-
nw_connection_group_copy_path_for_message
@Nullable public static @Nullable nw_path_t nw_connection_group_copy_path_for_message(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_content_context_t context)
[@function] nw_connection_group_copy_path_for_message Copy the path associated with a given inbound connection group message.- Parameters:
group- The connection group object.context- A content context representing an inbound message received from this connection group.- Returns:
- Returns the path associated with the provided message, or nil if the context is not a valid inbound message received from this connection group. API-Since: 14.0
-
nw_connection_group_reply
public static void nw_connection_group_reply(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_content_context_t inbound_message, @NotNull @NotNull nw_content_context_t outbound_message, @Nullable @Nullable dispatch_data_t content)[@function] nw_connection_group_reply Send data in response to an inbound message received by a connection group.- Parameters:
group- The connection group object from which the reply_context was received.inbound_message- The inbound message received by the connection group for which this is a response. An inbound message may be replied to exactly once.outbound_message- The outbound message to send in response to the message received by the connection group. The response context can also hold protocol metadata to define how to send content, such as flags for IP packets. If the context is marked as "final", the connection group will expect that no further communication is expected during this connection with the peer and may close the underlying transport. Subsequent connection attempts from the peer will continue to be delivered as incoming messages.content- A data object to send as the message body. This may be NULL if the outgoing context represents a metadata only message that contains no body data. API-Since: 14.0
-
nw_connection_group_extract_connection_for_message
@Nullable public static @Nullable nw_connection_t nw_connection_group_extract_connection_for_message(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_content_context_t context)
[@function] nw_connection_group_extract_connection_for_message Extract a connection corresponding to an inbound message from the connection group. Once extracted, subsequent messages from this remote endpoint on this connection will no longer be handled by the connection group. The connection may be used to read the remainder of a partial message or to send a large response with support for partial messages and backpressure. Any incoming messages from this remote endpoint which were saved from the receive handler may no longer be valid after a connection is returned. An extracted connection must have a queue set and be started before it can be used.- Parameters:
group- The connection group object from which the context was received. If the context was not received from this connection group, the extraction will fail.context- A content context representing an inbound message received from this connection group.- Returns:
- Returns the connection associated with the provided message, or nil if the extraction fails. Extraction will fail if the provided message is not an inbound message from this connection group. API-Since: 14.0
-
nw_connection_group_send_message
public static void nw_connection_group_send_message(@NotNull @NotNull nw_connection_group_t group, @Nullable @Nullable dispatch_data_t content, @Nullable @Nullable nw_endpoint_t endpoint, @NotNull @NotNull nw_content_context_t context, @NotNull @NotNull Network.Block_nw_connection_group_send_message completion)[@function] nw_connection_group_send_message Send data that is not in response to an inbound message. This outgoing message will be sent from the local endpoint on which the connection group is listening for incoming messages. This is an asynchronous send and the completion block can be used to determine when the send is complete. There is nothing preventing a client from issuing an excessive number of outstanding sends. To minimize memory footprint and excessive latency as a consequence of buffer bloat, it is advisable to keep a low number of outstanding sends. The completion block can be used to pace subsequent sends.- Parameters:
group- The connection group object from which to send the outbound data.content- A data object to send as the message body. This may be NULL if the outgoing context represents a metadata only message that contains no body data.endpoint- The destination endpoint to which the outbound message should be sent. If the endpoint is NULL, the message will be sent to all members of the group.context- An outbound message to send from the connection group. The context can also hold protocol metadata to define how to send content, such as flags for IP packets. If the context is marked as "final", the connection group will expect that no further communication is expected during this connection with the peer and may close the underlying transport. Subsequent connection attempts from the peer will be delivered as incoming messages.completion- A callback to be called when the message has been sent, or an error has occurred. This callback does not indicate that the remote side has acknowledged the data. This callback does indicate that the data has either been sent or it has been enqueued to be sent. API-Since: 14.0
-
nw_resolution_report_get_source
public static int nw_resolution_report_get_source(@NotNull @NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_source Check the source of a resolution, such as query or cache.- Parameters:
resolution_report- A resolution report.- Returns:
- The source of the resolution (query or cache). API-Since: 14.0
-
nw_resolution_report_get_milliseconds
public static long nw_resolution_report_get_milliseconds(@NotNull @NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_milliseconds Get the number of milliseconds spent on this resolution step.- Parameters:
resolution_report- A resolution report.- Returns:
- The number of milliseconds spent on this resolution step. API-Since: 14.0
-
nw_resolution_report_get_endpoint_count
public static int nw_resolution_report_get_endpoint_count(@NotNull @NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_endpoint_count Get the number of resolved endpoints discovered by the resolution step.- Parameters:
resolution_report- A resolution report.- Returns:
- The number of resolved endpoints discovered by the resolution step. API-Since: 14.0
-
nw_resolution_report_copy_successful_endpoint
@NotNull public static @NotNull nw_endpoint_t nw_resolution_report_copy_successful_endpoint(@NotNull @NotNull nw_resolution_report_t resolution_report)
[@function] nw_resolution_report_copy_successful_endpoint Copy the resolved endpoint that led to a successful connection.- Parameters:
resolution_report- A resolution report.- Returns:
- The resolved endpoint that led to a successful connection. API-Since: 14.0
-
nw_resolution_report_copy_preferred_endpoint
@NotNull public static @NotNull nw_endpoint_t nw_resolution_report_copy_preferred_endpoint(@NotNull @NotNull nw_resolution_report_t resolution_report)
[@function] nw_resolution_report_copy_preferred_endpoint Copy first resolved endpoint attempted, which may be the same as the successful endpoint.- Parameters:
resolution_report- A resolution report.- Returns:
- The first resolved endpoint attempted. API-Since: 14.0
-
nw_resolution_report_get_protocol
public static int nw_resolution_report_get_protocol(@NotNull @NotNull nw_resolution_report_t resolution_report)[@function] nw_resolution_report_get_protocol Check the protocol used for endpoint resolution.- Parameters:
resolution_report- A resolution report.- Returns:
- The protocol used for endpoint resolution. API-Since: 14.0
-
nw_establishment_report_enumerate_resolution_reports
public static void nw_establishment_report_enumerate_resolution_reports(@NotNull @NotNull nw_establishment_report_t report, @NotNull @NotNull Network.Block_nw_establishment_report_enumerate_resolution_reports enumerate_block)[@function] nw_establishment_report_enumerate_resolution_reports Enumerate the steps of connection establishment that involved endpoint resolution, such as DNS hostname resolution and Bonjour service resolution. This variant provides resolution report objects, which allow more detailed access to information. The provided block will be called inline zero or more times.- Parameters:
report- An establishment report.enumerate_block- A block to be invoked zero or more times, once for each step of resolution used during connection establishment. Each block contains a nw_resolution_report_t. Returning true from the block indicates that the enumeration should continue. Returning false indicates that the enumeration should stop. API-Since: 14.0
-
nw_ip_options_set_disable_multicast_loopback
public static void nw_ip_options_set_disable_multicast_loopback(@NotNull @NotNull nw_protocol_options_t options, boolean disable_multicast_loopback)[@function] nw_ip_options_set_disable_multicast_loopback If a multicast packet is sent to a group to which the sending host itself belongs (on the outgoing interface), a copy of the datagram is, by default, looped back by the IP layer for local delivery. Setting the disable_multicast_loopback option disables this behavior and, if set, multicast packets will not be looped back to the sender. Only applies to multicast packets.- Parameters:
options- An IP protocol options object.disable_multicast_loopback- If multicast loopback should be disabled. API-Since: 14.0
-
nw_path_monitor_prohibit_interface_type
public static void nw_path_monitor_prohibit_interface_type(@NotNull @NotNull nw_path_monitor_t monitor, int interface_type)[@function] nw_path_monitor_prohibit_interface_type Prohibit this path monitor from using the provided network interface type. Call before calling nw_path_monitor_start.- Parameters:
monitor- The path monitor object.interface_type- The interface type to prohibit for the path monitor. API-Since: 14.0
-
_nw_privacy_context_default_context
@NotNull public static @NotNull nw_privacy_context_t _nw_privacy_context_default_context()
API-Since: 14.0
-
nw_path_get_unsatisfied_reason
public static int nw_path_get_unsatisfied_reason(@NotNull @NotNull nw_path_t path)[@function] nw_path_get_unsatisfied_reason Retrieves a reason the path is not satisfied. In some cases, the reason helps to determine why the path is not satisfied. While the path may be unsatisfied for more than one reason, only the first reason will be given. In many cases, the path may be unsatisfied with no reason available.- Parameters:
path- The path object to check.- Returns:
- Returns a reason the path is unsatisfied or nw_path_unsatisfied_reason_not_available if a reason is not available. API-Since: 14.2
-
nw_parameters_create_quic
@NotNull public static @NotNull nw_parameters_t nw_parameters_create_quic(@NotNull @NotNull Network.Block_nw_parameters_create_quic configure_quic)
[@function] nw_parameters_create_quic Creates a parameters object that is configured for QUIC. The caller must pass in a block to configure options.- Parameters:
configure_quic- A block to configure QUIC. The caller must pass a custom block to configure the QUIC options.- Returns:
- Returns an allocated nw_parameters_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. Returns NULL on failure. Fails due to invalid parameters. API-Since: 15.0
-
nw_parameters_set_attribution
public static void nw_parameters_set_attribution(@NotNull @NotNull nw_parameters_t parameters, byte attribution)[@function] nw_parameters_set_attribution In order to help differentiate communication with domains requested by the user from those requested by the developer, attribution may be used. Attribution defaults to nw_parameters_attribution_developer. Setting attribution to nw_parameters_attribution_user indicates that the networking performed using these parameters is directed to content specified by the user, not the developer.- Parameters:
parameters- The parameters to modify.attribution- The entity to attribute the network operations to. API-Since: 15.0
-
nw_parameters_get_attribution
public static byte nw_parameters_get_attribution(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_get_attribution Returns the attribution set on the parameters.- Parameters:
parameters- The parameters to check.- Returns:
- Returns the attribution property of the parameters. API-Since: 15.0
-
nw_group_descriptor_create_multiplex
@NotNull public static @NotNull nw_group_descriptor_t nw_group_descriptor_create_multiplex(@NotNull @NotNull nw_endpoint_t remote_endpoint)
[@function] nw_group_descriptor_create_multiplex Creates a new group descriptor object based on an endpoint to which communication will be established using a multiplexing protocol, represented as an nw_endpoint containing the remote endpoint to use for communication.- Parameters:
remote_endpoint- An endpoint that can be used for communication over a multiplexing protocol.- Returns:
- An instantiated group descriptor object or nil if the specified endpoint is not valid. API-Since: 15.0
-
nw_connection_group_copy_protocol_metadata_for_message
@Nullable public static @Nullable nw_protocol_metadata_t nw_connection_group_copy_protocol_metadata_for_message(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_content_context_t context, @NotNull @NotNull nw_protocol_definition_t definition)
[@function] nw_connection_group_copy_protocol_metadata_for_message Copy the metadata corresponding to a given inbound connection group message.- Parameters:
group- The connection group object.definition- The protocol definition for which metadata will be returned.- Returns:
- Returns a retained protocol metadata object, or NULL if not found. API-Since: 15.0
-
nw_connection_group_extract_connection
@Nullable public static @Nullable nw_connection_t nw_connection_group_extract_connection(@NotNull @NotNull nw_connection_group_t group, @Nullable @Nullable nw_endpoint_t endpoint, @Nullable @Nullable nw_protocol_options_t protocol_options)
[@function] nw_connection_group_extract_connection Extract a connection from the connection group. For a multiplex connection group, this means that a new stream is opened and the corresponding nw_connection_t object is returned. For non-multiplex connection groups, a connection to the specified endpoint will be returned if allowed by the group descriptor. The connection can be re-inserted into the group later. Once reinserted, the connection group will handle subsequent messages from this remote endpoint. An extracted connection must have a queue set and be started before it can be used.- Parameters:
group- The connection group object from which to extract a connection.endpoint- The endpoint to use as the remote endpoint for the extracted connection, if applicable. For connection groups with multiplex group descriptors, this should be nil.protocol_options- The protocol options to apply to the extracted connection. May be nil if not applicable.- Returns:
- Returns the connection from the connection group. API-Since: 15.0
-
nw_connection_group_reinsert_extracted_connection
public static boolean nw_connection_group_reinsert_extracted_connection(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_connection_t connection)[@function] nw_connection_group_reinsert_extracted_connection Reinsert a connection into a connection group. Once reinserted, the connection group will handle subsequent messages from this remote endpoint, and any outstanding reads on the connection will be cancelled.- Parameters:
group- The connection group object from which the connection was extracted. If the connection was not extracted from this connection group, the reinsertion will fail.connection- A connection that was extracted from this connection group.- Returns:
- Returns true if the reinsertion was successful. Reinsertion will fail if the provided connection was not extracted from this connection group. API-Since: 15.0
-
nw_connection_group_set_new_connection_handler
public static void nw_connection_group_set_new_connection_handler(@NotNull @NotNull nw_connection_group_t group, @Nullable @Nullable Network.Block_nw_connection_group_set_new_connection_handler new_connection_handler)[@function] nw_connection_group_set_new_connection_handler Sets the new connection handler to be invoked whenever a new inbound connection is received by the connection group. This function must not be called after starting the connection group.- Parameters:
group- The connection group object.new_connection_handler- The new connection handler to call upon receipt of a new inbound connection. Pass NULL to remove the handler. API-Since: 15.0
-
nw_connection_group_copy_protocol_metadata
@Nullable public static @Nullable nw_protocol_metadata_t nw_connection_group_copy_protocol_metadata(@NotNull @NotNull nw_connection_group_t group, @NotNull @NotNull nw_protocol_definition_t definition)
[@function] nw_connection_group_copy_protocol_metadata Copy the metadata corresponding to a given inbound connection group message.- Parameters:
group- The connection group object.definition- The protocol definition for which metadata will be returned.- Returns:
- Returns a retained protocol metadata object, or NULL if the connection group has not been established yet or is cancelled. API-Since: 15.0
-
nw_data_transfer_report_get_path_radio_type
public static int nw_data_transfer_report_get_path_radio_type(@NotNull @NotNull nw_data_transfer_report_t report, int path_index)[@function] nw_data_transfer_report_get_path_radio_type Retrieve the radio type used for data transfer for a given path used by a connection.- Parameters:
report- A data transfer report in the "collected" state.path_index- The index for the path over which data is transferred. Passing NW_ALL_PATHS for this function is equivalent to passing 0.- Returns:
- Returns the radio type used for the specified path. Returns nw_interface_radio_type_unknown on failure. Fails if the report is not yet collected. API-Since: 15.0
-
nw_listener_set_new_connection_group_handler
public static void nw_listener_set_new_connection_group_handler(@NotNull @NotNull nw_listener_t listener, @Nullable @Nullable Network.Block_nw_listener_set_new_connection_group_handler handler)[@function] nw_listener_set_new_connection_group_handler Sets a new connection group handler to be called upon receiving an incoming connection that has a multiplexing protocol in its connected protocol stack. Must be called before nw_listener_start. Note that this handler is mutually exclusive with the new connection handler that is set via nw_listener_set_new_connection_handler. Only one of these handlers may be set at one time.- Parameters:
listener- The listener object.handler- The event handler to call when the listener receives a new connection group. Pass NULL to remove the new connection group handler. API-Since: 15.0
-
nw_protocol_copy_quic_definition
@NotNull public static @NotNull nw_protocol_definition_t nw_protocol_copy_quic_definition()
[@function] nw_protocol_copy_quic_definition Access the definition of the default system protocol implementation of QUIC. This protocol can be used as part of a connection's protocol stack as a transport protocol.- Returns:
- Returns a retained protocol definition object. API-Since: 15.0
-
nw_quic_create_options
@NotNull public static @NotNull nw_protocol_options_t nw_quic_create_options()
[@function] nw_quic_create_options Create an instance of QUIC protocol options. This object can be added to an nw_protocol_stack_t to be used in an nw_connection_t or an nw_listener_t.- Returns:
- Returns a retained protocol options object. API-Since: 15.0
-
nw_protocol_options_is_quic
public static boolean nw_protocol_options_is_quic(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_protocol_options_is_quic Checks whether the given protocol options define a QUIC protocol.- Returns:
- Returns true if the protocol options are for QUIC, false otherwise. API-Since: 15.0
-
nw_quic_add_tls_application_protocol
public static void nw_quic_add_tls_application_protocol(@NotNull @NotNull nw_protocol_options_t options, @NotNull @NotNull java.lang.String application_protocol)[@function] nw_quic_add_tls_application_protocol Adds an Application-Layer Protocol Negotiation (ALPN) value to present in the TLS handshake.- Parameters:
options- An nw_protocol_options_t for QUIC. API-Since: 15.0
-
nw_quic_copy_sec_protocol_options
@NotNull public static @NotNull sec_protocol_options_t nw_quic_copy_sec_protocol_options(@NotNull @NotNull nw_protocol_options_t options)
[@function] nw_quic_copy_sec_protocol_options Access the sec_protocol_options_t for a given QUIC options instance. Seefor functions to further configure security options. - Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- Returns a retained sec_protocol_options_t object. API-Since: 15.0
-
nw_quic_get_stream_is_unidirectional
public static boolean nw_quic_get_stream_is_unidirectional(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_stream_is_unidirectional Returns whether or not a QUIC stream is unidirectional.- Parameters:
options- An nw_protocol_options_t for a QUIC stream.- Returns:
- True if the stream is unidirectional, false otherwise. API-Since: 15.0
-
nw_quic_set_stream_is_unidirectional
public static void nw_quic_set_stream_is_unidirectional(@NotNull @NotNull nw_protocol_options_t options, boolean is_unidirectional)[@function] nw_quic_set_stream_is_unidirectional Set whether or not a QUIC stream should be unidirectional.- Parameters:
options- An nw_protocol_options_t for a QUIC stream.is_unidirectional- True if the stream is unidirectional, false otherwise. API-Since: 15.0
-
nw_quic_get_initial_max_data
public static long nw_quic_get_initial_max_data(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_data Get the initial_max_data transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- The initial_max_data that a client is willing to receive on a connection. API-Since: 15.0
-
nw_quic_set_initial_max_data
public static void nw_quic_set_initial_max_data(@NotNull @NotNull nw_protocol_options_t options, long initial_max_data)[@function] nw_quic_set_initial_max_data Set the initial_max_data transport parameter on a QUIC connection. Setting this option requires initial_max_stream_data_bidirectional_local, initial_max_stream_data_bidirectional_remote and initial_max_stream_data_unidirectional also to be set.- Parameters:
options- An nw_protocol_options_t for QUIC.initial_max_data- The initial_max_data controls how much data, in bytes, a client is willing to receive on a connection. API-Since: 15.0
-
nw_quic_get_max_udp_payload_size
public static char nw_quic_get_max_udp_payload_size(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_max_udp_payload_size Get the maximum length of a QUIC packet (UDP payload) that the client is willing to receive on a connection, in bytes.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- The max_udp_payload_size value, in bytes. API-Since: 15.0
-
nw_quic_set_max_udp_payload_size
public static void nw_quic_set_max_udp_payload_size(@NotNull @NotNull nw_protocol_options_t options, char max_udp_payload_size)[@function] nw_quic_set_max_udp_payload_size Define the maximum length of a QUIC packet (UDP payload) that the client is willing to receive on a connection, in bytes.- Parameters:
options- An nw_protocol_options_t for QUIC.max_udp_payload_size- The max_udp_payload_size value, in bytes. API-Since: 15.0
-
nw_quic_get_idle_timeout
public static int nw_quic_get_idle_timeout(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_idle_timeout Get the idle timeout value for the QUIC connection. If no packets are sent or received within this timeout, the QUIC connection will be closed.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- The idle_timeout value, in milliseconds. API-Since: 15.0
-
nw_quic_set_idle_timeout
public static void nw_quic_set_idle_timeout(@NotNull @NotNull nw_protocol_options_t options, int idle_timeout)[@function] nw_quic_set_idle_timeout Define an idle timeout value for the QUIC connection. If no packets are sent or received within this timeout, the QUIC connection will be closed.- Parameters:
options- An nw_protocol_options_t for QUIC.idle_timeout- The idle_timeout value, in milliseconds. API-Since: 15.0
-
nw_quic_get_initial_max_streams_bidirectional
public static long nw_quic_get_initial_max_streams_bidirectional(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_streams_bidirectional Get the initial value of maximum bidirectional streams that the peer can initiate on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- The initial value for the maximum concurrent bidirectional streams. API-Since: 15.0
-
nw_quic_set_initial_max_streams_bidirectional
public static void nw_quic_set_initial_max_streams_bidirectional(@NotNull @NotNull nw_protocol_options_t options, long initial_max_streams_bidirectional)[@function] nw_quic_set_initial_max_streams_bidirectional Set the initial value of maximum bidirectional streams that the peer can initiate on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.initial_max_streams_bidirectional- The initial value for the maximum concurrent bidirectional streams. API-Since: 15.0
-
nw_quic_get_initial_max_streams_unidirectional
public static long nw_quic_get_initial_max_streams_unidirectional(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_streams_unidirectional Get the initial value of maximum unidirectional streams that the peer can initiate on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- The initial value for the maximum concurrent unidirectional streams. API-Since: 15.0
-
nw_quic_set_initial_max_streams_unidirectional
public static void nw_quic_set_initial_max_streams_unidirectional(@NotNull @NotNull nw_protocol_options_t options, long initial_max_streams_unidirectional)[@function] nw_quic_set_initial_max_streams_unidirectional Set the initial value of maximum unidirectional streams that the peer can initiate on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.initial_max_streams_unidirectional- The initial value for the maximum concurrent unidirectional streams. API-Since: 15.0
-
nw_quic_get_initial_max_stream_data_bidirectional_local
public static long nw_quic_get_initial_max_stream_data_bidirectional_local(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_stream_data_bidirectional_local Get the initial_max_stream_data_bidi_local transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- How much data the client is willing to receive on a locally initiated stream. API-Since: 15.0
-
nw_quic_set_initial_max_stream_data_bidirectional_local
public static void nw_quic_set_initial_max_stream_data_bidirectional_local(@NotNull @NotNull nw_protocol_options_t options, long initial_max_stream_data_bidirectional_local)[@function] nw_quic_set_initial_max_stream_data_bidirectional_local Set the initial_max_stream_data_bidi_local transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.initial_max_stream_data_bidirectional_local- The initial_max_stream_data_bidi_local controls how much data the client is willing to receive on a locally initiated stream. API-Since: 15.0
-
nw_quic_get_initial_max_stream_data_bidirectional_remote
public static long nw_quic_get_initial_max_stream_data_bidirectional_remote(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_stream_data_bidirectional_remote Get the initial_max_stream_data_bidi_remote transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- How much data the client is willing to receive on a remotely initiated stream. API-Since: 15.0
-
nw_quic_set_initial_max_stream_data_bidirectional_remote
public static void nw_quic_set_initial_max_stream_data_bidirectional_remote(@NotNull @NotNull nw_protocol_options_t options, long initial_max_stream_data_bidirectional_remote)[@function] nw_quic_set_initial_max_stream_data_bidirectional_remote Set the initial_max_stream_data_bidi_remote transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.initial_max_stream_data_bidirectional_remote- The initial_max_stream_data_bidi_remote controls how much data the client is willing to receive on a remotely initiated stream. API-Since: 15.0
-
nw_quic_get_initial_max_stream_data_unidirectional
public static long nw_quic_get_initial_max_stream_data_unidirectional(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_initial_max_stream_data_unidirectional Get the initial_max_stream_data_uni transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- How much data the client is willing to receive on a unidirectional stream. API-Since: 15.0
-
nw_quic_set_initial_max_stream_data_unidirectional
public static void nw_quic_set_initial_max_stream_data_unidirectional(@NotNull @NotNull nw_protocol_options_t options, long initial_max_stream_data_unidirectional)[@function] nw_quic_set_initial_max_stream_data_unidirectional Set the initial_max_stream_data_uni transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.initial_max_stream_data_unidirectional- The initial_max_stream_data_uni controls how much data the client is willing to receive on a unidirectional stream. API-Since: 15.0
-
nw_protocol_metadata_is_quic
public static boolean nw_protocol_metadata_is_quic(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_protocol_metadata_is_quic Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of QUIC.- Returns:
- Returns true if the metadata is for the default system QUIC, false otherwise. API-Since: 15.0
-
nw_quic_copy_sec_protocol_metadata
@NotNull public static @NotNull sec_protocol_metadata_t nw_quic_copy_sec_protocol_metadata(@NotNull @NotNull nw_protocol_metadata_t metadata)
[@function] nw_quic_copy_sec_protocol_metadata Access the sec_protocol_metadata_t for a given QUIC connection metadata instance. Seefor functions to further configure security options. Will be filled out on connected instances of QUIC for metadata returned by nw_connection_copy_protocol_metadata. - Parameters:
metadata- An nw_protocol_metadata_t for QUIC.- Returns:
- Returns a retained sec_protocol_metadata_t object. API-Since: 15.0
-
nw_quic_get_stream_id
public static long nw_quic_get_stream_id(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_stream_id Get the QUIC stream ID.- Parameters:
metadata- A nw_protocol_metadata_t for a QUIC stream.- Returns:
- Returns the QUIC stream id. API-Since: 15.0
-
nw_quic_get_stream_application_error
public static long nw_quic_get_stream_application_error(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_stream_application_error Access the Application Error value received from the peer in a stream close message.- Parameters:
metadata- A nw_protocol_metadata_t for a QUIC stream.- Returns:
- Returns the Application Error code value received from by the peer, or UINT64_MAX if no error has been received. API-Since: 15.0
-
nw_quic_set_stream_application_error
public static void nw_quic_set_stream_application_error(@NotNull @NotNull nw_protocol_metadata_t metadata, long application_error)[@function] nw_quic_set_stream_application_error Set an Application Error value to send to the peer when the stream is closed.- Parameters:
metadata- A nw_protocol_metadata_t for a QUIC stream.application_error- An application-specific error code value. API-Since: 15.0
-
nw_quic_get_local_max_streams_bidirectional
public static long nw_quic_get_local_max_streams_bidirectional(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_local_max_streams_bidirectional Get the most recent value of the maximum number of bidirectional streams that the peer can create.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the most recent value of the peer's max number of bidirectional streams. API-Since: 15.0
-
nw_quic_set_local_max_streams_bidirectional
public static void nw_quic_set_local_max_streams_bidirectional(@NotNull @NotNull nw_protocol_metadata_t metadata, long max_streams_bidirectional)[@function] nw_quic_set_local_max_streams_bidirectional Sets the maximum number of bidirectional streams that the peer can create.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.max_streams_bidirectional- The new number of maximum bidirectional streams. API-Since: 15.0
-
nw_quic_get_local_max_streams_unidirectional
public static long nw_quic_get_local_max_streams_unidirectional(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_local_max_streams_unidirectional Get the most recent value of the maximum number of unidirectional streams that the peer can create.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the most recent value of the peer's max number of unidirectional streams. API-Since: 15.0
-
nw_quic_set_local_max_streams_unidirectional
public static void nw_quic_set_local_max_streams_unidirectional(@NotNull @NotNull nw_protocol_metadata_t metadata, long max_streams_unidirectional)[@function] nw_quic_set_local_max_streams_unidirectional Sets the maximum number of unidirectional streams that the peer can create.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.max_streams_unidirectional- The new number of maximum unidirectional streams. API-Since: 15.0
-
nw_quic_get_remote_max_streams_bidirectional
public static long nw_quic_get_remote_max_streams_bidirectional(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_remote_max_streams_bidirectional Get the maximum number of bidirectional streams advertised by peer that an application is allowed to create. Note that while attempts to create streams above this limit will be blocked until the server increases the limit, these blocked attempts will cause a STREAMS_BLOCKED frame to be sent to the server. This informs the server that the client has more streams it would like to create. As a result, the caller should attempt to create streams over this limit if it desires more streams.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the most recent value of the peer's advertised max number of bidirectional streams. API-Since: 15.0
-
nw_quic_get_remote_max_streams_unidirectional
public static long nw_quic_get_remote_max_streams_unidirectional(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_remote_max_streams_unidirectional Get the maximum number of unidirectional streams advertised by peer that an application is allowed to create. Note that while attempts to create streams above this limit will be blocked until the server increases the limit, these blocked attempts will cause a STREAMS_BLOCKED frame to be sent to the server. This informs the server that the client has more streams it would like to create. As a result, the caller should attempt to create streams over this limit if it desires more streams.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the most recent value of the peer's advertised max number of unidirectional streams. API-Since: 15.0
-
nw_quic_get_application_error
public static long nw_quic_get_application_error(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_application_error Access the Application Error value received from the peer in a connection close message.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the Application Error code value received from by the peer, or UINT64_MAX if no error has been received. API-Since: 15.0
-
nw_quic_get_application_error_reason
@Nullable public static @Nullable java.lang.String nw_quic_get_application_error_reason(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_application_error_reason Access the Application Error reason string received from the peer in a connection close message.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the Application Error reason received from by the peer, or NULL if no error reason has been received. API-Since: 15.0
-
nw_quic_set_application_error
public static void nw_quic_set_application_error(@NotNull @NotNull nw_protocol_metadata_t metadata, long application_error, @Nullable @Nullable java.lang.String reason)[@function] nw_quic_set_application_error Set the Application Error value to send to the peer in a connection close message.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.application_error- Sets the Application Error code value.reason- An optional reason string to associate with the error. API-Since: 15.0
-
nw_quic_get_keepalive_interval
public static char nw_quic_get_keepalive_interval(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_keepalive_interval Retrieves the keep-alive interval set on a QUIC connection.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns value of the keep-alive interval, in seconds, or 0 if the keep-alive timer is disabled. API-Since: 15.0
-
nw_quic_set_keepalive_interval
public static void nw_quic_set_keepalive_interval(@NotNull @NotNull nw_protocol_metadata_t metadata, char keepalive_interval)[@function] nw_quic_set_keepalive_interval Changes the keep-alive interval for QUIC. QUIC connections are encrypted and operate over the UDP protocol which makes it hard for Network Address Translators and firewalls to track their state. For this reason, these middleboxes may use short timeouts for QUIC flows. By sending keep-alive packets (QUIC PING frames), the endpoint can maintain state of the flow across the network. Keep-alives should only be enabled while there is an outstanding exchange of information with the remote endpoint that has not yet completed, it is not recommended to enable keep-alive packets on an idle connection that is not expecting to send or receive data in the near future.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.keepalive_interval- The keep-alive interval for QUIC, in seconds, or 0 if the keep-alive timer is disabled. Pass `NW_QUIC_CONNECTION_DEFAULT_KEEPALIVE` to use the default keep-alive interval. API-Since: 15.0
-
nw_quic_get_remote_idle_timeout
public static long nw_quic_get_remote_idle_timeout(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_remote_idle_timeout Access the idle_timeout value in milliseconds received from the peer in the transport parameters.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the idle_timeout value in milliseconds received from the peer. API-Since: 15.0
-
nw_tcp_options_set_multipath_force_version
public static void nw_tcp_options_set_multipath_force_version(@NotNull @NotNull nw_protocol_options_t options, int multipath_force_version)[@function] nw_tcp_options_set_multipath_force_version Configure MPTCP to use a specified MPTCP standard version. This ignores the cached value from MPTCP version discovery.- Parameters:
options- A TCP protocol options object.multipath_force_version- The MPTCP version. API-Since: 15.0
-
nw_advertise_descriptor_create_application_service
@NotNull public static @NotNull nw_advertise_descriptor_t nw_advertise_descriptor_create_application_service(@NotNull @NotNull java.lang.String application_service_name)
[@function] nw_advertise_descriptor_create_application_service Creates an advertise descriptor for application service discovery.- Parameters:
application_service_name- The service name to advertise.- Returns:
- An instantiated advertise descriptor object. API-Since: 16.0
-
nw_advertise_descriptor_get_application_service_name
@Nullable public static @Nullable java.lang.String nw_advertise_descriptor_get_application_service_name(@NotNull @NotNull nw_advertise_descriptor_t advertise_descriptor)[@function] nw_advertise_descriptor_get_application_service_name Returns the service name of an application service advertise descriptor.- Parameters:
advertise_descriptor- An advertise descriptor object.- Returns:
- The service name or NULL if the advertise descriptor is not of the correct type. API-Since: 16.0
-
nw_endpoint_copy_txt_record
@Nullable public static @Nullable nw_txt_record_t nw_endpoint_copy_txt_record(@NotNull @NotNull nw_endpoint_t endpoint)
[@function] nw_endpoint_copy_txt_record Retrieves the TXT record associated with the endpoint, if present. TXT records can be populated during browsing and connection establishment.- Parameters:
endpoint- The endpoint object.- Returns:
- Returns a retained nw_txt_record_t object if a TXT record is associated with this endpoint, or NULL otherwise. API-Since: 16.0
-
nw_endpoint_get_signature
@Nullable public static @Nullable java.lang.String nw_endpoint_get_signature(@NotNull @NotNull nw_endpoint_t endpoint, @NotNull @NotNull org.moe.natj.general.ptr.NUIntPtr out_signature_length)[@function] nw_endpoint_get_signature Retrieves a signed data blob associated with an endpoint.- Parameters:
endpoint- The endpoint to modify.out_signature_length- A pointer to a size_t that will take the length of the signature.- Returns:
- Returns a pointer to a buffer of bytes containing a signature, or NULL if the endpoint is not signed. API-Since: 16.0
-
nw_parameters_create_application_service
@NotNull public static @NotNull nw_parameters_t nw_parameters_create_application_service()
[@function] nw_parameters_create_application_service Creates default parameters for use with application services.- Returns:
- Returns an allocated nw_parameters_t object on success. Callers are responsible for deallocating using nw_release(obj) or [obj release]. These objects support ARC. API-Since: 16.0
-
nw_parameters_set_requires_dnssec_validation
public static void nw_parameters_set_requires_dnssec_validation(@NotNull @NotNull nw_parameters_t parameters, boolean requires_dnssec_validation)[@function] nw_parameters_set_requires_dnssec_validation Require to do or not to do DNSSEC validation when resolving the endpoint, before making a connection. DNSSEC validation only takes effect if making a connection to an endpoint that requires domain name resolution, such as:nw_endpoint_type_hostnw_endpoint_type_url1. If this property is not set or is set to false on the parameters, DNSSEC validation will not be required. 2. If this property is set to true and no additional DNSSEC configuration is set on the parameters, the default behavior will be followed: Only DNSSEC secure and DNSSEC insecure resolved result will be used to establish a connection. 3. If this property is set to true and additional DNSSEC configuration is set on the parameters, the behavior specified by that configuration will be followed. API-Since: 16.0- Parameters:
parameters- The parameters object to configure.requires_dnssec_validation- A boolean value that indicates if DNSSEC validation should be required when doing DNS resolution for the endpoint.
-
nw_parameters_requires_dnssec_validation
public static boolean nw_parameters_requires_dnssec_validation(@NotNull @NotNull nw_parameters_t parameters)[@function] nw_parameters_requires_dnssec_validation Check if DNSSEC validation is required.- Parameters:
parameters- The parameters object to check.- Returns:
- Returns true if DNSSEC validation is required, false otherwise. API-Since: 16.0
-
nw_browse_descriptor_create_application_service
@NotNull public static @NotNull nw_browse_descriptor_t nw_browse_descriptor_create_application_service(@NotNull @NotNull java.lang.String application_service_name)
[@function] nw_browse_descriptor_create_application_service Creates a browse descriptor for application service discovery.- Parameters:
application_service_name- The service name to browse for.- Returns:
- An instantiated browse descriptor object. API-Since: 16.0
-
nw_browse_descriptor_get_application_service_name
@Nullable public static @Nullable java.lang.String nw_browse_descriptor_get_application_service_name(@NotNull @NotNull nw_browse_descriptor_t descriptor)[@function] nw_browse_descriptor_get_application_service_name Returns the service name of an application service browse descriptor.- Parameters:
descriptor- A browse descriptor object.- Returns:
- The service name. API-Since: 16.0
-
nw_framer_options_set_object_value
public static void nw_framer_options_set_object_value(@NotNull @NotNull nw_protocol_options_t options, @NotNull @NotNull java.lang.String key, @Nullable @Nullable java.lang.Object value)[@function] nw_framer_options_set_object_value Set a key-value pair on framer options, where the value is a reference-counted object.- Parameters:
options- The framer options object.key- The string key to identify the value.value- A reference counted object to store. API-Since: 15.4
-
nw_framer_options_copy_object_value
@Nullable public static @Nullable java.lang.Object nw_framer_options_copy_object_value(@NotNull @NotNull nw_protocol_options_t options, @NotNull @NotNull java.lang.String key)[@function] nw_framer_options_copy_object_value Copy the stored object value using a key on framer options.- Parameters:
options- The framer options object.key- The string key to identify the value.- Returns:
- Returns a reference counted object with a +1 reference count, or NULL if no value was found for the specified key. API-Since: 15.4
-
nw_framer_copy_options
@NotNull public static @NotNull nw_protocol_options_t nw_framer_copy_options(@NotNull @NotNull nw_framer_t framer)
[@function] nw_framer_copy_options Access the protocol options being used for a given instance of a framer.- Parameters:
framer- The framer instance.- Returns:
- Returns a retained protocol options object. API-Since: 15.4
-
nw_quic_get_stream_is_datagram
public static boolean nw_quic_get_stream_is_datagram(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_stream_is_datagram Get whether or not the QUIC stream is a QUIC datagram flow.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- is_datagram True if the QUIC stream is a QUIC datagram flow. API-Since: 16.0
-
nw_quic_set_stream_is_datagram
public static void nw_quic_set_stream_is_datagram(@NotNull @NotNull nw_protocol_options_t options, boolean is_datagram)[@function] nw_quic_set_stream_is_datagram Set whether or not the QUIC stream should be a QUIC datagram flow. Only one QUIC datagram flow can be created per connection.- Parameters:
options- An nw_protocol_options_t for QUIC.is_datagram- A boolean to indicate whether or not the QUIC stream should be a QUIC datagram flow. API-Since: 16.0
-
nw_quic_get_max_datagram_frame_size
public static char nw_quic_get_max_datagram_frame_size(@NotNull @NotNull nw_protocol_options_t options)[@function] nw_quic_get_max_datagram_frame_size Get the max_datagram_frame_size transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.- Returns:
- If greater than zero, the max_datagram_frame_size value indicates that DATAGRAM frames are supported, and describes the maximum number of bytes that a single DATAGRAM frame can contain. API-Since: 16.0
-
nw_quic_set_max_datagram_frame_size
public static void nw_quic_set_max_datagram_frame_size(@NotNull @NotNull nw_protocol_options_t options, char max_datagram_frame_size)[@function] nw_quic_set_max_datagram_frame_size Set the max_datagram_frame_size transport parameter on a QUIC connection.- Parameters:
options- An nw_protocol_options_t for QUIC.max_datagram_frame_size- If greater than zero, the max_datagram_frame_size value indicates that DATAGRAM frames are supported, and describes the maximum number of bytes that a single DATAGRAM frame can contain. API-Since: 16.0
-
nw_quic_get_stream_type
public static byte nw_quic_get_stream_type(@NotNull @NotNull nw_protocol_metadata_t stream_metadata)[@function] nw_quic_stream_get_type Describes the type of the QUIC stream.- Parameters:
stream_metadata- A nw_protocol_metadata_t for a QUIC stream.- Returns:
- Returns the type of the QUIC stream, stored in nw_quic_stream_type_t. If the type can not be determined, returns nw_quic_stream_type_unknown. API-Since: 15.0
-
nw_quic_get_stream_usable_datagram_frame_size
public static char nw_quic_get_stream_usable_datagram_frame_size(@NotNull @NotNull nw_protocol_metadata_t metadata)[@function] nw_quic_get_stream_usable_datagram_frame_size Get the usable size of a datagram frame from a QUIC datagram flow.- Parameters:
metadata- A nw_protocol_metadata_t for QUIC.- Returns:
- Returns the usable datagram frame size. API-Since: 16.0
-
nw_retain
public static org.moe.natj.general.ptr.VoidPtr nw_retain(org.moe.natj.general.ptr.VoidPtr obj)
API-Since: 12.0
-
nw_release
public static void nw_release(org.moe.natj.general.ptr.VoidPtr obj)
API-Since: 12.0
-
nw_relay_hop_create
@NotNull public static @NotNull nw_relay_hop_t nw_relay_hop_create(@Nullable @Nullable nw_endpoint_t http3_relay_endpoint, @Nullable @Nullable nw_endpoint_t http2_relay_endpoint, @Nullable @Nullable nw_protocol_options_t relay_tls_options)
[@function] nw_relay_hop_create Creates a configuration for a secure relay. A relay is a proxy that is accessible using HTTP/3, HTTP/2, or both, and uses the CONNECT method to proxy TCP or UDP connections. At least one of `http3_relay_endpoint` and `http2_relay_endpoint` must be non-null.- Parameters:
http3_relay_endpoint- A URL or host endpoint identifying the relay server accessible using HTTP/3.http2_relay_endpoint- A URL or host endpoint identifying the relay server accessible using HTTP/2.relay_tls_options- Optional TLS options to use for the TLS handshake to the relay. If this is null, default TLS options will be used.- Returns:
- Returns an allocated `nw_relay_hop_t` object on success. API-Since: 17.0
-
nw_relay_hop_add_additional_http_header_field
public static void nw_relay_hop_add_additional_http_header_field(@NotNull @NotNull nw_relay_hop_t relay_hop, @NotNull @NotNull java.lang.String field_name, @NotNull @NotNull java.lang.String field_value)[@function] nw_relay_hop_add_additional_http_header_field Adds additional HTTP headers to send as part of CONNECT requests to the relay.- Parameters:
relay_hop- The proxy hop object.field_name- The HTTP header field name.field_value- The HTTP header field value. API-Since: 17.0
-
nw_proxy_config_create_relay
@NotNull public static @NotNull nw_proxy_config_t nw_proxy_config_create_relay(@NotNull @NotNull nw_relay_hop_t first_hop, @Nullable @Nullable nw_relay_hop_t second_hop)
[@function] nw_proxy_config_create_relay Creates a proxy configuration with one or two secure relay hops.- Parameters:
first_hop- The first or only relay hop.second_hop- An optional second relay hop.- Returns:
- Returns an allocated `nw_proxy_config_t` object on success. API-Since: 17.0
-
nw_proxy_config_create_oblivious_http
@NotNull public static @NotNull nw_proxy_config_t nw_proxy_config_create_oblivious_http(@NotNull @NotNull nw_relay_hop_t relay, @NotNull @NotNull java.lang.String relay_resource_path, @NotNull @NotNull java.lang.String gateway_key_config, long gateway_key_config_length)
[@function] nw_proxy_config_create_oblivious_http Creates a proxy configuration for an Oblivious HTTP relay and gateway. Note that Oblivious HTTP proxy configurations must also have specific match domains specified using `nw_proxy_config_add_match_domain`.- Parameters:
relay- The Oblivious HTTP relay hop.relay_resource_path- The HTTP path to use for requests to the Oblivious HTTP relay that will forward requests to the gateway.gateway_key_config- The key configuration for the Oblivious HTTP gateway, or a list of key configurations where each configuration is prefixed with a two-byte length in network byte order.gateway_key_config_length- The length of the buffer in `gateway_key_config`.- Returns:
- Returns an allocated `nw_proxy_config_t` object on success. API-Since: 17.0
-
nw_proxy_config_create_http_connect
@NotNull public static @NotNull nw_proxy_config_t nw_proxy_config_create_http_connect(@NotNull @NotNull nw_endpoint_t proxy_endpoint, @Nullable @Nullable nw_protocol_options_t proxy_tls_options)
[@function] nw_proxy_config_create_http_connect Creates a legacy HTTP CONNECT proxy configuration for a proxy server accessible using HTTP/1.1. This proxy will only relay TCP connections.- Parameters:
proxy_endpoint- A host endpoint identifying the proxy server accessible using HTTP/1.1.proxy_tls_options- Optional TLS options to use for a TLS handshake to the relay. If no options are provided, the proxy will be accessed using cleartext HTTP.- Returns:
- Returns an allocated `nw_proxy_config_t` object on success. API-Since: 17.0
-
nw_proxy_config_create_socksv5
@NotNull public static @NotNull nw_proxy_config_t nw_proxy_config_create_socksv5(@NotNull @NotNull nw_endpoint_t proxy_endpoint)
[@function] nw_proxy_config_create_socksv5 Creates a SOCKSv5 proxy configuration.- Parameters:
proxy_endpoint- A host endpoint identifying the SOCKS proxy server.- Returns:
- Returns an allocated `nw_proxy_config_t` object on success. API-Since: 17.0
-
nw_proxy_config_set_username_and_password
public static void nw_proxy_config_set_username_and_password(@NotNull @NotNull nw_proxy_config_t proxy_config, @NotNull @NotNull java.lang.String username, @Nullable @Nullable java.lang.String password)[@function] nw_proxy_config_set_username_and_password Configures a username and password to use with a proxy configuration.- Parameters:
proxy_config- The proxy configuration object.username- A proxy authentication username.password- A proxy authentication password. API-Since: 17.0
-
nw_proxy_config_set_failover_allowed
public static void nw_proxy_config_set_failover_allowed(@NotNull @NotNull nw_proxy_config_t proxy_config, boolean failover_allowed)[@function] nw_proxy_config_set_failover_allowed Set whether or not a proxy configuration allows failover to non-proxied connections. Failover is not allowed by default.- Parameters:
proxy_config- The proxy configuration object.failover_allowed- A Boolean indicating if failover is allowed. API-Since: 17.0
-
nw_proxy_config_get_failover_allowed
public static boolean nw_proxy_config_get_failover_allowed(@NotNull @NotNull nw_proxy_config_t proxy_config)[@function] nw_proxy_config_get_failover_allowed Check whether or not a proxy configuration allows failover to non-proxied connections.- Parameters:
proxy_config- The proxy configuration object.- Returns:
- A Boolean indicating if failover is allowed. API-Since: 17.0
-
nw_proxy_config_add_match_domain
public static void nw_proxy_config_add_match_domain(@NotNull @NotNull nw_proxy_config_t config, @NotNull @NotNull java.lang.String match_domain)[@function] nw_proxy_config_add_match_domain Adds a domain to define which hosts should use the proxy.- Parameters:
config- The proxy configuration object.match_domain- The domain suffix to match hostnames against, as a string. API-Since: 17.0
-
nw_proxy_config_clear_match_domains
public static void nw_proxy_config_clear_match_domains(@NotNull @NotNull nw_proxy_config_t config)[@function] nw_proxy_config_clear_match_domains Clears all match domains defined for the proxy.- Parameters:
config- The proxy configuration object. API-Since: 17.0
-
nw_proxy_config_add_excluded_domain
public static void nw_proxy_config_add_excluded_domain(@NotNull @NotNull nw_proxy_config_t config, @NotNull @NotNull java.lang.String excluded_domain)[@function] nw_proxy_config_add_excluded_domain Adds a domain to define which hosts should not use the proxy.- Parameters:
config- The proxy configuration object.excluded_domain- The domain suffix to match hostnames against, as a string. API-Since: 17.0
-
nw_proxy_config_clear_excluded_domains
public static void nw_proxy_config_clear_excluded_domains(@NotNull @NotNull nw_proxy_config_t config)[@function] nw_proxy_config_clear_excluded_domains Clears all excluded domains defined for the proxy.- Parameters:
config- The proxy configuration object. API-Since: 17.0
-
nw_proxy_config_enumerate_match_domains
public static void nw_proxy_config_enumerate_match_domains(@NotNull @NotNull nw_proxy_config_t config, @NotNull @NotNull Network.Block_nw_proxy_config_enumerate_match_domains enumerator)[@function] nw_proxy_config_enumerate_match_domains Enumerate all match domains set on the proxy configuration.- Parameters:
config- The proxy configuration object.enumerator- A block that will get invoked for every domain that was added to the proxy configuration. API-Since: 17.0
-
nw_proxy_config_enumerate_excluded_domains
public static void nw_proxy_config_enumerate_excluded_domains(@NotNull @NotNull nw_proxy_config_t config, @NotNull @NotNull Network.Block_nw_proxy_config_enumerate_excluded_domains enumerator)[@function] nw_proxy_config_enumerate_excluded_domains Enumerate all excluded domains set on the proxy configuration.- Parameters:
config- The proxy configuration object.enumerator- A block that will get invoked for every domain that was added to the proxy configuration. API-Since: 17.0
-
nw_privacy_context_add_proxy
public static void nw_privacy_context_add_proxy(@NotNull @NotNull nw_privacy_context_t privacy_context, @NotNull @NotNull nw_proxy_config_t proxy_config)[@function] nw_privacy_context_add_proxy Add a proxy configuration to apply to all connections that participate in this context. If set on `NW_DEFAULT_PRIVACY_CONTEXT`, this will additionally apply to other networking APIs used by the calling process.- Parameters:
privacy_context- A privacy context to modify. This can include the default privacy context.proxy_config- A proxy configuration object to apply to all connections that use this context. API-Since: 17.0
-
nw_privacy_context_clear_proxies
public static void nw_privacy_context_clear_proxies(@NotNull @NotNull nw_privacy_context_t privacy_context)[@function] nw_privacy_context_clear_proxies Clear out any proxies added using `nw_privacy_context_add_proxy`.- Parameters:
privacy_context- A privacy context to modify. This can include the default privacy context. API-Since: 17.0
-
-