public final class Network
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static NSObject |
_nw_content_context_default_message() |
static NSObject |
_nw_content_context_default_stream() |
static NSObject |
_nw_content_context_final_send() |
static int |
_nw_data_transfer_report_all_paths()
[@const] NW_ALL_PATHS
|
static NSObject |
_nw_privacy_context_default_context() |
static CFStringRef |
kNWErrorDomainDNS()
Values will be DNSServiceErrorType errors
|
static CFStringRef |
kNWErrorDomainPOSIX()
Values will be POSIX errors
|
static CFStringRef |
kNWErrorDomainTLS()
Values will be errSSL* errors
|
static NSObject |
nw_advertise_descriptor_copy_txt_record_object(NSObject advertise_descriptor)
[@function] nw_advertise_descriptor_copy_txt_record_object
|
static NSObject |
nw_advertise_descriptor_create_bonjour_service(java.lang.String name,
java.lang.String type,
java.lang.String domain)
[@function] nw_advertise_descriptor_create_bonjour_service
|
static boolean |
nw_advertise_descriptor_get_no_auto_rename(NSObject advertise_descriptor)
[@function] nw_advertise_descriptor_get_no_auto_rename
|
static void |
nw_advertise_descriptor_set_no_auto_rename(NSObject advertise_descriptor,
boolean no_auto_rename)
[@function] nw_advertise_descriptor_set_no_auto_rename
|
static void |
nw_advertise_descriptor_set_txt_record_object(NSObject advertise_descriptor,
NSObject txt_record)
[@function] nw_advertise_descriptor_set_txt_record_object
|
static void |
nw_advertise_descriptor_set_txt_record(NSObject advertise_descriptor,
org.moe.natj.general.ptr.ConstVoidPtr txt_record,
long txt_length)
[@function] nw_advertise_descriptor_set_txt_record
|
static NSObject |
nw_browse_descriptor_create_bonjour_service(java.lang.String type,
java.lang.String domain)
[@function] nw_browse_descriptor_create_bonjour_service
|
static java.lang.String |
nw_browse_descriptor_get_bonjour_service_domain(NSObject descriptor)
[@function] nw_browse_descriptor_get_bonjour_service_domain
|
static java.lang.String |
nw_browse_descriptor_get_bonjour_service_type(NSObject descriptor)
[@function] nw_browse_descriptor_get_bonjour_service_type
|
static boolean |
nw_browse_descriptor_get_include_txt_record(NSObject descriptor)
[@function] nw_browse_descriptor_get_include_txt_record
|
static void |
nw_browse_descriptor_set_include_txt_record(NSObject descriptor,
boolean include_txt_record)
[@function] nw_browse_descriptor_set_include_txt_record
|
static NSObject |
nw_browse_result_copy_endpoint(NSObject result)
[@function] nw_browse_result_copy_endpoint
|
static NSObject |
nw_browse_result_copy_txt_record_object(NSObject result)
[@function] nw_browse_result_copy_txt_record_object
|
static void |
nw_browse_result_enumerate_interfaces(NSObject result,
Network.Block_nw_browse_result_enumerate_interfaces enumerator)
[@function] nw_browse_result_enumerate_interfaces
|
static long |
nw_browse_result_get_changes(NSObject old_result,
NSObject new_result)
[@function] nw_browse_result_get_changes
|
static long |
nw_browse_result_get_interfaces_count(NSObject result)
[@function] nw_browse_result_get_interfaces_count
|
static void |
nw_browser_cancel(NSObject browser)
[@function] nw_browser_cancel
|
static NSObject |
nw_browser_copy_browse_descriptor(NSObject browser)
[@function] nw_browser_copy_browse_descriptor
|
static NSObject |
nw_browser_copy_parameters(NSObject browser)
[@function] nw_browser_copy_parameters
|
static NSObject |
nw_browser_create(NSObject descriptor,
NSObject parameters)
[@function] nw_browser_create
|
static void |
nw_browser_set_browse_results_changed_handler(NSObject browser,
Network.Block_nw_browser_set_browse_results_changed_handler handler)
[@function] nw_browser_set_browse_results_changed_handler
|
static void |
nw_browser_set_queue(NSObject browser,
NSObject queue)
[@function] nw_browser_set_queue
|
static void |
nw_browser_set_state_changed_handler(NSObject browser,
Network.Block_nw_browser_set_state_changed_handler state_changed_handler)
[@function] nw_browser_set_state_changed_handler
|
static void |
nw_browser_start(NSObject browser)
[@function] nw_browser_start
|
static void |
nw_connection_access_establishment_report(NSObject connection,
NSObject queue,
Network.Block_nw_connection_access_establishment_report access_block)
[@function] nw_connection_access_establishment_report
|
static void |
nw_connection_batch(NSObject connection,
Network.Block_nw_connection_batch batch_block)
[@function] nw_connection_batch
|
static void |
nw_connection_cancel_current_endpoint(NSObject connection)
[@function] nw_connection_cancel_current_endpoint
|
static void |
nw_connection_cancel(NSObject connection)
[@function] nw_connection_cancel
|
static NSObject |
nw_connection_copy_current_path(NSObject connection)
[@function] nw_connection_copy_current_path
|
static org.moe.natj.general.ptr.BytePtr |
nw_connection_copy_description(NSObject connection)
[@function] nw_connection_copy_description
|
static NSObject |
nw_connection_copy_endpoint(NSObject connection)
[@function] nw_connection_copy_endpoint
|
static NSObject |
nw_connection_copy_parameters(NSObject connection)
[@function] nw_connection_copy_parameters
|
static NSObject |
nw_connection_copy_protocol_metadata(NSObject connection,
NSObject definition)
[@function] nw_connection_copy_protocol_metadata
|
static NSObject |
nw_connection_create_new_data_transfer_report(NSObject connection)
[@function] nw_connection_create_new_data_transfer_report
|
static NSObject |
nw_connection_create(NSObject endpoint,
NSObject parameters)
[@function] nw_connection_create
|
static void |
nw_connection_force_cancel(NSObject connection)
[@function] nw_connection_force_cancel
|
static int |
nw_connection_get_maximum_datagram_size(NSObject connection)
[@function] nw_connection_get_maximum_datagram_size
|
static void |
nw_connection_group_cancel(NSObject group)
[@function] nw_connection_group_cancel
|
static NSObject |
nw_connection_group_copy_descriptor(NSObject group)
[@function] nw_connection_group_copy_descriptor
|
static NSObject |
nw_connection_group_copy_local_endpoint_for_message(NSObject group,
NSObject context)
[@function] nw_connection_group_copy_local_endpoint_for_message
|
static NSObject |
nw_connection_group_copy_parameters(NSObject group)
[@function] nw_connection_group_copy_parameters
|
static NSObject |
nw_connection_group_copy_path_for_message(NSObject group,
NSObject context)
[@function] nw_connection_group_copy_path_for_message
|
static NSObject |
nw_connection_group_copy_protocol_metadata_for_message(NSObject group,
NSObject context,
NSObject definition)
[@function] nw_connection_group_copy_protocol_metadata_for_message
|
static NSObject |
nw_connection_group_copy_protocol_metadata(NSObject group,
NSObject definition)
[@function] nw_connection_group_copy_protocol_metadata
|
static NSObject |
nw_connection_group_copy_remote_endpoint_for_message(NSObject group,
NSObject context)
[@function] nw_connection_group_copy_remote_endpoint_for_message
|
static NSObject |
nw_connection_group_create(NSObject group_descriptor,
NSObject parameters)
[@function] nw_connection_group_create
|
static NSObject |
nw_connection_group_extract_connection_for_message(NSObject group,
NSObject context)
[@function] nw_connection_group_extract_connection_for_message
|
static NSObject |
nw_connection_group_extract_connection(NSObject group,
NSObject endpoint,
NSObject protocol_options)
[@function] nw_connection_group_extract_connection
|
static boolean |
nw_connection_group_reinsert_extracted_connection(NSObject group,
NSObject connection)
[@function] nw_connection_group_reinsert_extracted_connection
|
static void |
nw_connection_group_reply(NSObject group,
NSObject inbound_message,
NSObject outbound_message,
NSObject content)
[@function] nw_connection_group_reply
|
static void |
nw_connection_group_send_message(NSObject group,
NSObject content,
NSObject endpoint,
NSObject context,
Network.Block_nw_connection_group_send_message completion)
[@function] nw_connection_group_send_message
|
static void |
nw_connection_group_set_new_connection_handler(NSObject group,
Network.Block_nw_connection_group_set_new_connection_handler new_connection_handler)
[@function] nw_connection_group_set_new_connection_handler
|
static void |
nw_connection_group_set_queue(NSObject group,
NSObject queue)
[@function] nw_connection_group_set_queue
|
static void |
nw_connection_group_set_receive_handler(NSObject group,
int maximum_message_size,
boolean reject_oversized_messages,
Network.Block_nw_connection_group_set_receive_handler receive_handler)
[@function] nw_connection_group_set_receive_handler
|
static void |
nw_connection_group_set_state_changed_handler(NSObject group,
Network.Block_nw_connection_group_set_state_changed_handler state_changed_handler)
[@function] nw_connection_group_set_state_changed_handler
|
static void |
nw_connection_group_start(NSObject group)
[@function] nw_connection_group_start
|
static void |
nw_connection_receive_message(NSObject connection,
Network.Block_nw_connection_receive_message completion)
[@function] nw_connection_receive_message
|
static void |
nw_connection_receive(NSObject connection,
int minimum_incomplete_length,
int maximum_length,
Network.Block_nw_connection_receive completion)
[@function] nw_connection_receive
|
static void |
nw_connection_restart(NSObject connection)
[@function] nw_connection_restart
|
static void |
nw_connection_send(NSObject connection,
NSObject content,
NSObject context,
boolean is_complete,
Network.Block_nw_connection_send completion)
[@function] nw_connection_send
|
static void |
nw_connection_set_better_path_available_handler(NSObject connection,
Network.Block_nw_connection_set_better_path_available_handler handler)
[@function] nw_connection_set_better_path_available_handler
|
static void |
nw_connection_set_path_changed_handler(NSObject connection,
Network.Block_nw_connection_set_path_changed_handler handler)
[@function] nw_connection_set_path_changed_handler
|
static void |
nw_connection_set_queue(NSObject connection,
NSObject queue)
[@function] nw_connection_set_queue
|
static void |
nw_connection_set_state_changed_handler(NSObject connection,
Network.Block_nw_connection_set_state_changed_handler handler)
[@function] nw_connection_set_state_changed_handler
|
static void |
nw_connection_set_viability_changed_handler(NSObject connection,
Network.Block_nw_connection_set_viability_changed_handler handler)
[@function] nw_connection_set_viability_changed_handler
|
static void |
nw_connection_start(NSObject connection)
[@function] nw_connection_start
|
static NSObject |
nw_content_context_copy_antecedent(NSObject context)
[@function] nw_content_context_copy_antecedent
|
static NSObject |
nw_content_context_copy_protocol_metadata(NSObject context,
NSObject protocol)
[@function] nw_content_context_copy_protocol_metadata
|
static NSObject |
nw_content_context_create(java.lang.String context_identifier)
[@function] nw_content_context_create
|
static void |
nw_content_context_foreach_protocol_metadata(NSObject context,
Network.Block_nw_content_context_foreach_protocol_metadata foreach_block)
[@function] nw_content_context_foreach_protocol_metadata
|
static long |
nw_content_context_get_expiration_milliseconds(NSObject context)
[@function] nw_content_context_get_expiration_milliseconds
|
static java.lang.String |
nw_content_context_get_identifier(NSObject context)
[@function] nw_content_context_get_identifier
|
static boolean |
nw_content_context_get_is_final(NSObject context)
[@function] nw_content_context_get_is_final
|
static double |
nw_content_context_get_relative_priority(NSObject context)
[@function] nw_content_context_get_relative_priority
|
static void |
nw_content_context_set_antecedent(NSObject context,
NSObject antecedent_context)
[@function] nw_content_context_set_antecedent
|
static void |
nw_content_context_set_expiration_milliseconds(NSObject context,
long expiration_milliseconds)
[@function] nw_content_context_set_expiration_milliseconds
|
static void |
nw_content_context_set_is_final(NSObject context,
boolean is_final)
[@function] nw_content_context_set_is_final
|
static void |
nw_content_context_set_metadata_for_protocol(NSObject context,
NSObject protocol_metadata)
[@function] nw_content_context_set_metadata_for_protocol
|
static void |
nw_content_context_set_relative_priority(NSObject context,
double relative_priority)
[@function] nw_content_context_set_relative_priority
|
static void |
nw_data_transfer_report_collect(NSObject report,
NSObject queue,
Network.Block_nw_data_transfer_report_collect collect_block)
[@function] nw_data_transfer_report_collect
|
static NSObject |
nw_data_transfer_report_copy_path_interface(NSObject report,
int path_index)
[@function] nw_data_transfer_report_copy_path_interface
|
static long |
nw_data_transfer_report_get_duration_milliseconds(NSObject report)
[@function] nw_data_transfer_report_get_duration_milliseconds
|
static int |
nw_data_transfer_report_get_path_count(NSObject report)
[@function] nw_data_transfer_report_get_path_count
|
static int |
nw_data_transfer_report_get_path_radio_type(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_path_radio_type
|
static long |
nw_data_transfer_report_get_received_application_byte_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_received_application_byte_count
|
static long |
nw_data_transfer_report_get_received_ip_packet_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_received_ip_packet_count
|
static long |
nw_data_transfer_report_get_received_transport_byte_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_received_transport_byte_count
|
static long |
nw_data_transfer_report_get_received_transport_duplicate_byte_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_received_transport_duplicate_byte_count
|
static long |
nw_data_transfer_report_get_received_transport_out_of_order_byte_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_received_transport_out_of_order_byte_count
|
static long |
nw_data_transfer_report_get_sent_application_byte_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_sent_application_byte_count
|
static long |
nw_data_transfer_report_get_sent_ip_packet_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_sent_ip_packet_count
|
static long |
nw_data_transfer_report_get_sent_transport_byte_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_sent_transport_byte_count
|
static long |
nw_data_transfer_report_get_sent_transport_retransmitted_byte_count(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_sent_transport_retransmitted_byte_count
|
static int |
nw_data_transfer_report_get_state(NSObject report)
[@function] nw_data_transfer_report_get_state
|
static long |
nw_data_transfer_report_get_transport_minimum_rtt_milliseconds(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_transport_minimum_rtt_milliseconds
|
static long |
nw_data_transfer_report_get_transport_rtt_variance(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_transport_rtt_variance
|
static long |
nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds(NSObject report,
int path_index)
[@function] nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds
|
static org.moe.natj.general.ptr.BytePtr |
nw_endpoint_copy_address_string(NSObject endpoint)
[@function] nw_endpoint_copy_address_string
|
static org.moe.natj.general.ptr.BytePtr |
nw_endpoint_copy_port_string(NSObject endpoint)
[@function] nw_endpoint_copy_port_string
|
static NSObject |
nw_endpoint_create_address(sockaddr address)
[@function] nw_endpoint_create_address
|
static NSObject |
nw_endpoint_create_bonjour_service(java.lang.String name,
java.lang.String type,
java.lang.String domain)
[@function] nw_endpoint_create_bonjour_service
|
static NSObject |
nw_endpoint_create_host(java.lang.String hostname,
java.lang.String port)
[@function] nw_endpoint_create_host
|
static NSObject |
nw_endpoint_create_url(java.lang.String url)
[@function] nw_endpoint_create_url
|
static sockaddr |
nw_endpoint_get_address(NSObject endpoint)
[@function] nw_endpoint_get_address
|
static java.lang.String |
nw_endpoint_get_bonjour_service_domain(NSObject endpoint)
[@function] nw_endpoint_get_bonjour_service_domain
|
static java.lang.String |
nw_endpoint_get_bonjour_service_name(NSObject endpoint)
[@function] nw_endpoint_get_bonjour_service_name
|
static java.lang.String |
nw_endpoint_get_bonjour_service_type(NSObject endpoint)
[@function] nw_endpoint_get_bonjour_service_type
|
static java.lang.String |
nw_endpoint_get_hostname(NSObject endpoint)
[@function] nw_endpoint_get_hostname
|
static char |
nw_endpoint_get_port(NSObject endpoint)
[@function] nw_endpoint_get_port
|
static int |
nw_endpoint_get_type(NSObject endpoint)
[@function] nw_endpoint_get_type
|
static java.lang.String |
nw_endpoint_get_url(NSObject endpoint)
[@function] nw_endpoint_get_url
|
static CFErrorRef |
nw_error_copy_cf_error(NSObject error)
[@function] nw_error_copy_cf_error
|
static int |
nw_error_get_error_code(NSObject error)
[@function] nw_error_get_error_code
|
static int |
nw_error_get_error_domain(NSObject error)
[@function] nw_error_get_error_domain
|
static NSObject |
nw_establishment_report_copy_proxy_endpoint(NSObject report)
[@function] nw_establishment_report_copy_proxy_endpoint
|
static void |
nw_establishment_report_enumerate_protocols(NSObject report,
Network.Block_nw_establishment_report_enumerate_protocols enumerate_block)
[@function] nw_establishment_report_enumerate_protocols
|
static void |
nw_establishment_report_enumerate_resolution_reports(NSObject report,
Network.Block_nw_establishment_report_enumerate_resolution_reports enumerate_block)
[@function] nw_establishment_report_enumerate_resolution_reports
|
static void |
nw_establishment_report_enumerate_resolutions(NSObject report,
Network.Block_nw_establishment_report_enumerate_resolutions enumerate_block)
[@function] nw_establishment_report_enumerate_resolutions
|
static long |
nw_establishment_report_get_attempt_started_after_milliseconds(NSObject report)
[@function] nw_establishment_report_get_attempt_started_after_milliseconds
|
static long |
nw_establishment_report_get_duration_milliseconds(NSObject report)
[@function] nw_establishment_report_get_duration_milliseconds
|
static int |
nw_establishment_report_get_previous_attempt_count(NSObject report)
[@function] nw_establishment_report_get_previous_attempt_count
|
static boolean |
nw_establishment_report_get_proxy_configured(NSObject report)
[@function] nw_establishment_report_get_proxy_configured
|
static boolean |
nw_establishment_report_get_used_proxy(NSObject report)
[@function] nw_establishment_report_get_used_proxy
|
static void |
nw_framer_async(NSObject framer,
Network.Block_nw_framer_async async_block)
[@function] nw_framer_async
|
static NSObject |
nw_framer_copy_local_endpoint(NSObject framer)
[@function] nw_framer_copy_local_endpoint
|
static NSObject |
nw_framer_copy_parameters(NSObject framer)
[@function] nw_framer_copy_parameters
|
static NSObject |
nw_framer_copy_remote_endpoint(NSObject framer)
[@function] nw_framer_copy_remote_endpoint
|
static NSObject |
nw_framer_create_definition(java.lang.String identifier,
int flags,
Network.Block_nw_framer_create_definition start_handler)
[@function] nw_framer_create_definition
|
static NSObject |
nw_framer_create_options(NSObject framer_definition)
[@function] nw_framer_create_options
|
static boolean |
nw_framer_deliver_input_no_copy(NSObject framer,
long input_length,
NSObject message,
boolean is_complete)
[@function] nw_framer_deliver_input_no_copy
|
static void |
nw_framer_deliver_input(NSObject framer,
java.lang.String input_buffer,
long input_length,
NSObject message,
boolean is_complete)
[@function] nw_framer_deliver_input
|
static void |
nw_framer_mark_failed_with_error(NSObject framer,
int error_code)
[@function] nw_framer_mark_failed_with_error
|
static void |
nw_framer_mark_ready(NSObject framer)
[@function] nw_framer_mark_ready
|
static boolean |
nw_framer_message_access_value(NSObject message,
java.lang.String key,
Network.Block_nw_framer_message_access_value access_value)
[@function] nw_framer_message_access_value
|
static java.lang.Object |
nw_framer_message_copy_object_value(NSObject message,
java.lang.String key)
[@function] nw_framer_message_copy_object_value
|
static NSObject |
nw_framer_message_create(NSObject framer)
[@function] nw_framer_message_create
|
static void |
nw_framer_message_set_object_value(NSObject message,
java.lang.String key,
java.lang.Object value)
[@function] nw_framer_message_set_object_value
|
static void |
nw_framer_message_set_value(NSObject message,
java.lang.String key,
org.moe.natj.general.ptr.VoidPtr value,
Network.Block_nw_framer_message_set_value dispose_value)
[@function] nw_framer_message_set_value
|
static boolean |
nw_framer_parse_input(NSObject framer,
long minimum_incomplete_length,
long maximum_length,
org.moe.natj.general.ptr.BytePtr temp_buffer,
Network.Block_nw_framer_parse_input parse)
[@function] nw_framer_parse_input
|
static boolean |
nw_framer_parse_output(NSObject framer,
long minimum_incomplete_length,
long maximum_length,
org.moe.natj.general.ptr.BytePtr temp_buffer,
Network.Block_nw_framer_parse_output parse)
[@function] nw_framer_parse_output
|
static void |
nw_framer_pass_through_input(NSObject framer)
[@function] nw_framer_pass_through_input
|
static void |
nw_framer_pass_through_output(NSObject framer)
[@function] nw_framer_pass_through_output
|
static boolean |
nw_framer_prepend_application_protocol(NSObject framer,
NSObject protocol_options)
[@function] nw_framer_prepend_application_protocol
|
static NSObject |
nw_framer_protocol_create_message(NSObject definition)
[@function] nw_framer_protocol_create_message
|
static void |
nw_framer_schedule_wakeup(NSObject framer,
long milliseconds)
[@function] nw_framer_schedule_wakeup
|
static void |
nw_framer_set_cleanup_handler(NSObject framer,
Network.Block_nw_framer_set_cleanup_handler cleanup_handler)
[@function] nw_framer_set_cleanup_handler
|
static void |
nw_framer_set_input_handler(NSObject framer,
Network.Block_nw_framer_set_input_handler input_handler)
[@function] nw_framer_set_input_handler
|
static void |
nw_framer_set_output_handler(NSObject framer,
Network.Block_nw_framer_set_output_handler output_handler)
[@function] nw_framer_set_output_handler
|
static void |
nw_framer_set_stop_handler(NSObject framer,
Network.Block_nw_framer_set_stop_handler stop_handler)
[@function] nw_framer_set_stop_handler
|
static void |
nw_framer_set_wakeup_handler(NSObject framer,
Network.Block_nw_framer_set_wakeup_handler wakeup_handler)
[@function] nw_framer_set_wakeup_handler
|
static void |
nw_framer_write_output_data(NSObject framer,
NSObject output_data)
[@function] nw_framer_write_output_data
|
static boolean |
nw_framer_write_output_no_copy(NSObject framer,
long output_length)
[@function] nw_framer_write_output_no_copy
|
static void |
nw_framer_write_output(NSObject framer,
java.lang.String output_buffer,
long output_length)
[@function] nw_framer_write_output
|
static boolean |
nw_group_descriptor_add_endpoint(NSObject descriptor,
NSObject endpoint)
[@function] nw_group_descriptor_add_endpoint
|
static NSObject |
nw_group_descriptor_create_multicast(NSObject multicast_group)
[@function] nw_group_descriptor_create_multicast
|
static NSObject |
nw_group_descriptor_create_multiplex(NSObject remote_endpoint)
[@function] nw_group_descriptor_create_multiplex
|
static void |
nw_group_descriptor_enumerate_endpoints(NSObject descriptor,
Network.Block_nw_group_descriptor_enumerate_endpoints enumerate_block)
[@function] nw_group_descriptor_enumerate_endpoints
|
static int |
nw_interface_get_index(NSObject interface_)
[@function] nw_interface_get_index
|
static java.lang.String |
nw_interface_get_name(NSObject interface_)
[@function] nw_interface_get_name
|
static int |
nw_interface_get_type(NSObject interface_)
[@function] nw_interface_get_type
|
static NSObject |
nw_ip_create_metadata()
[@function] nw_ip_create_metadata
|
static int |
nw_ip_metadata_get_ecn_flag(NSObject metadata)
[@function] nw_ip_metadata_get_ecn_flag
|
static long |
nw_ip_metadata_get_receive_time(NSObject metadata)
[@function] nw_ip_metadata_get_receive_time
|
static int |
nw_ip_metadata_get_service_class(NSObject metadata)
[@function] nw_ip_metadata_get_service_class
|
static void |
nw_ip_metadata_set_ecn_flag(NSObject metadata,
int ecn_flag)
[@function] nw_ip_metadata_set_ecn_flag
|
static void |
nw_ip_metadata_set_service_class(NSObject metadata,
int service_class)
[@function] nw_ip_metadata_set_service_class
|
static void |
nw_ip_options_set_calculate_receive_time(NSObject options,
boolean calculate_receive_time)
[@function] nw_ip_options_set_calculate_receive_time
|
static void |
nw_ip_options_set_disable_fragmentation(NSObject options,
boolean disable_fragmentation)
[@function] nw_ip_options_set_disable_fragmentation
|
static void |
nw_ip_options_set_disable_multicast_loopback(NSObject options,
boolean disable_multicast_loopback)
[@function] nw_ip_options_set_disable_multicast_loopback
|
static void |
nw_ip_options_set_hop_limit(NSObject options,
byte hop_limit)
[@function] nw_ip_options_set_hop_limit
|
static void |
nw_ip_options_set_local_address_preference(NSObject options,
int preference)
[@function] nw_ip_options_set_local_address_preference
|
static void |
nw_ip_options_set_use_minimum_mtu(NSObject options,
boolean use_minimum_mtu)
[@function] nw_ip_options_set_use_minimum_mtu
|
static void |
nw_ip_options_set_version(NSObject options,
int version)
[@function] nw_ip_options_set_version
|
static void |
nw_listener_cancel(NSObject listener)
[@function] nw_listener_cancel
|
static NSObject |
nw_listener_create_with_connection(NSObject connection,
NSObject parameters)
[@function] nw_listener_create_with_connection
|
static NSObject |
nw_listener_create_with_port(java.lang.String port,
NSObject parameters)
[@function] nw_listener_create_with_port
|
static NSObject |
nw_listener_create(NSObject parameters)
[@function] nw_listener_create
|
static int |
nw_listener_get_new_connection_limit(NSObject listener)
[@function] nw_listener_get_new_connection_limit
|
static char |
nw_listener_get_port(NSObject listener)
[@function] nw_listener_get_port
|
static void |
nw_listener_set_advertise_descriptor(NSObject listener,
NSObject advertise_descriptor)
[@function] nw_listener_set_advertise_descriptor
|
static void |
nw_listener_set_advertised_endpoint_changed_handler(NSObject listener,
Network.Block_nw_listener_set_advertised_endpoint_changed_handler handler)
[@function] nw_listener_set_advertised_endpoint_changed_handler
|
static void |
nw_listener_set_new_connection_group_handler(NSObject listener,
Network.Block_nw_listener_set_new_connection_group_handler handler)
[@function] nw_listener_set_new_connection_group_handler
|
static void |
nw_listener_set_new_connection_handler(NSObject listener,
Network.Block_nw_listener_set_new_connection_handler handler)
[@function] nw_listener_set_new_connection_handler
|
static void |
nw_listener_set_new_connection_limit(NSObject listener,
int new_connection_limit)
[@function] nw_listener_set_new_connection_limit
|
static void |
nw_listener_set_queue(NSObject listener,
NSObject queue)
[@function] nw_listener_set_queue
|
static void |
nw_listener_set_state_changed_handler(NSObject listener,
Network.Block_nw_listener_set_state_changed_handler handler)
[@function] nw_listener_set_state_changed_handler
|
static void |
nw_listener_start(NSObject listener)
[@function] nw_listener_start
|
static boolean |
nw_multicast_group_descriptor_get_disable_unicast_traffic(NSObject multicast_descriptor)
[@function] nw_multicast_group_descriptor_get_disable_unicast_traffic
|
static void |
nw_multicast_group_descriptor_set_disable_unicast_traffic(NSObject multicast_descriptor,
boolean disable_unicast_traffic)
[@function] nw_multicast_group_descriptor_set_disable_unicast_traffic
|
static void |
nw_multicast_group_descriptor_set_specific_source(NSObject multicast_descriptor,
NSObject source)
[@function] nw_multicast_group_descriptor_set_specific_source
|
static void |
nw_parameters_clear_prohibited_interface_types(NSObject parameters)
[@function] nw_parameters_clear_prohibited_interface_types
|
static void |
nw_parameters_clear_prohibited_interfaces(NSObject parameters)
[@function] nw_parameters_clear_prohibited_interfaces
|
static NSObject |
nw_parameters_copy_default_protocol_stack(NSObject parameters)
[@function] nw_parameters_copy_default_protocol_stack
|
static NSObject |
nw_parameters_copy_local_endpoint(NSObject parameters)
[@function] nw_parameters_copy_local_endpoint
|
static NSObject |
nw_parameters_copy_required_interface(NSObject parameters)
[@function] nw_parameters_copy_required_interface
|
static NSObject |
nw_parameters_copy(NSObject parameters)
[@function] nw_parameters_copy
|
static NSObject |
nw_parameters_create_quic(Network.Block_nw_parameters_create_quic configure_quic)
[@function] nw_parameters_create_quic
|
static NSObject |
nw_parameters_create_secure_tcp(Network.Block_nw_parameters_create_secure_tcp_0 configure_tls,
Network.Block_nw_parameters_create_secure_tcp_1 configure_tcp)
[@function] nw_parameters_create_secure_tcp
|
static NSObject |
nw_parameters_create_secure_udp(Network.Block_nw_parameters_create_secure_udp_0 configure_dtls,
Network.Block_nw_parameters_create_secure_udp_1 configure_udp)
[@function] nw_parameters_create_secure_udp
|
static NSObject |
nw_parameters_create()
[@function] nw_parameters_create
|
static byte |
nw_parameters_get_attribution(NSObject parameters)
[@function] nw_parameters_get_attribution
|
static int |
nw_parameters_get_expired_dns_behavior(NSObject parameters)
[@function] nw_parameters_get_expired_dns_behavior
|
static boolean |
nw_parameters_get_fast_open_enabled(NSObject parameters)
[@function] nw_parameters_get_fast_open_enabled
|
static boolean |
nw_parameters_get_include_peer_to_peer(NSObject parameters)
[@function] nw_parameters_get_include_peer_to_peer
|
static boolean |
nw_parameters_get_local_only(NSObject parameters)
[@function] nw_parameters_get_local_only
|
static int |
nw_parameters_get_multipath_service(NSObject parameters)
[@function] nw_parameters_get_multipath_service
|
static boolean |
nw_parameters_get_prefer_no_proxy(NSObject parameters)
[@function] nw_parameters_get_prefer_no_proxy
|
static boolean |
nw_parameters_get_prohibit_constrained(NSObject parameters)
[@function] nw_parameters_get_prohibit_constrained
|
static boolean |
nw_parameters_get_prohibit_expensive(NSObject parameters)
[@function] nw_parameters_get_prohibit_expensive
|
static int |
nw_parameters_get_required_interface_type(NSObject parameters)
[@function] nw_parameters_get_required_interface_type
|
static boolean |
nw_parameters_get_reuse_local_address(NSObject parameters)
[@function] nw_parameters_get_reuse_local_address
|
static int |
nw_parameters_get_service_class(NSObject parameters)
[@function] nw_parameters_get_service_class
|
static void |
nw_parameters_iterate_prohibited_interface_types(NSObject parameters,
Network.Block_nw_parameters_iterate_prohibited_interface_types iterate_block)
[@function] nw_parameters_iterate_prohibited_interface_types
|
static void |
nw_parameters_iterate_prohibited_interfaces(NSObject parameters,
Network.Block_nw_parameters_iterate_prohibited_interfaces iterate_block)
[@function] nw_parameters_iterate_prohibited_interfaces
|
static void |
nw_parameters_prohibit_interface_type(NSObject parameters,
int interface_type)
[@function] nw_parameters_prohibit_interface_type
|
static void |
nw_parameters_prohibit_interface(NSObject parameters,
NSObject interface_)
[@function] nw_parameters_prohibit_interface
|
static void |
nw_parameters_require_interface(NSObject parameters,
NSObject interface_)
[@function] nw_parameters_require_interface
|
static void |
nw_parameters_set_attribution(NSObject parameters,
byte attribution)
[@function] nw_parameters_set_attribution
|
static void |
nw_parameters_set_expired_dns_behavior(NSObject parameters,
int expired_dns_behavior)
[@function] nw_parameters_set_expired_dns_behavior
|
static void |
nw_parameters_set_fast_open_enabled(NSObject parameters,
boolean fast_open_enabled)
[@function] nw_parameters_set_fast_open_enabled
|
static void |
nw_parameters_set_include_peer_to_peer(NSObject parameters,
boolean include_peer_to_peer)
[@function] nw_parameters_set_include_peer_to_peer
|
static void |
nw_parameters_set_local_endpoint(NSObject parameters,
NSObject local_endpoint)
[@function] nw_parameters_set_local_endpoint
|
static void |
nw_parameters_set_local_only(NSObject parameters,
boolean local_only)
[@function] nw_parameters_set_local_only
|
static void |
nw_parameters_set_multipath_service(NSObject parameters,
int multipath_service)
[@function] nw_parameters_set_multipath_service
|
static void |
nw_parameters_set_prefer_no_proxy(NSObject parameters,
boolean prefer_no_proxy)
[@function] nw_parameters_set_prefer_no_proxy
|
static void |
nw_parameters_set_privacy_context(NSObject parameters,
NSObject privacy_context)
[@function] nw_parameters_set_privacy_context
|
static void |
nw_parameters_set_prohibit_constrained(NSObject parameters,
boolean prohibit_constrained)
[@function] nw_parameters_set_prohibit_constrained
|
static void |
nw_parameters_set_prohibit_expensive(NSObject parameters,
boolean prohibit_expensive)
[@function] nw_parameters_set_prohibit_expensive
|
static void |
nw_parameters_set_required_interface_type(NSObject parameters,
int interface_type)
[@function] nw_parameters_set_required_interface_type
|
static void |
nw_parameters_set_reuse_local_address(NSObject parameters,
boolean reuse_local_address)
[@function] nw_parameters_set_reuse_local_address
|
static void |
nw_parameters_set_service_class(NSObject parameters,
int service_class)
[@function] nw_parameters_set_service_class
|
static NSObject |
nw_path_copy_effective_local_endpoint(NSObject path)
[@function] nw_path_copy_effective_local_endpoint
|
static NSObject |
nw_path_copy_effective_remote_endpoint(NSObject path)
[@function] nw_path_copy_effective_remote_endpoint
|
static void |
nw_path_enumerate_gateways(NSObject path,
Network.Block_nw_path_enumerate_gateways enumerate_block)
[@function] nw_path_enumerate_gateways
|
static void |
nw_path_enumerate_interfaces(NSObject path,
Network.Block_nw_path_enumerate_interfaces enumerate_block)
[@function] nw_path_enumerate_interfaces
|
static int |
nw_path_get_status(NSObject path)
[@function] nw_path_get_status
|
static int |
nw_path_get_unsatisfied_reason(NSObject path)
[@function] nw_path_get_unsatisfied_reason
|
static boolean |
nw_path_has_dns(NSObject path)
[@function] nw_path_has_dns
|
static boolean |
nw_path_has_ipv4(NSObject path)
[@function] nw_path_has_ipv4
|
static boolean |
nw_path_has_ipv6(NSObject path)
[@function] nw_path_has_ipv6
|
static boolean |
nw_path_is_constrained(NSObject path)
[@function] nw_path_is_constrained
|
static boolean |
nw_path_is_equal(NSObject path,
NSObject other_path)
[@function] nw_path_is_equal
|
static boolean |
nw_path_is_expensive(NSObject path)
[@function] nw_path_is_expensive
|
static void |
nw_path_monitor_cancel(NSObject monitor)
[@function] nw_path_monitor_cancel
|
static NSObject |
nw_path_monitor_create_with_type(int required_interface_type)
[@function] nw_path_monitor_create_with_type
|
static NSObject |
nw_path_monitor_create()
[@function] nw_path_monitor_create
|
static void |
nw_path_monitor_prohibit_interface_type(NSObject monitor,
int interface_type)
[@function] nw_path_monitor_prohibit_interface_type
|
static void |
nw_path_monitor_set_cancel_handler(NSObject monitor,
Network.Block_nw_path_monitor_set_cancel_handler cancel_handler)
[@function] nw_path_monitor_set_cancel_handler
|
static void |
nw_path_monitor_set_queue(NSObject monitor,
NSObject queue)
[@function] nw_path_monitor_set_queue
|
static void |
nw_path_monitor_set_update_handler(NSObject monitor,
Network.Block_nw_path_monitor_set_update_handler update_handler)
[@function] nw_path_monitor_set_update_handler
|
static void |
nw_path_monitor_start(NSObject monitor)
[@function] nw_path_monitor_start
|
static boolean |
nw_path_uses_interface_type(NSObject path,
int interface_type)
[@function] nw_path_uses_interface_type
|
static NSObject |
nw_privacy_context_create(java.lang.String description)
[@function] nw_privacy_context_create
|
static void |
nw_privacy_context_disable_logging(NSObject privacy_context)
[@function] nw_privacy_context_disable_logging
|
static void |
nw_privacy_context_flush_cache(NSObject privacy_context)
[@function] nw_privacy_context_flush_cache
|
static void |
nw_privacy_context_require_encrypted_name_resolution(NSObject privacy_context,
boolean require_encrypted_name_resolution,
NSObject fallback_resolver_config)
[@function] nw_privacy_context_require_encrypted_name_resolution
|
static NSObject |
nw_protocol_copy_ip_definition()
[@function] nw_protocol_copy_ip_definition
|
static NSObject |
nw_protocol_copy_quic_definition()
[@function] nw_protocol_copy_quic_definition
|
static NSObject |
nw_protocol_copy_tcp_definition()
[@function] nw_protocol_copy_tcp_definition
|
static NSObject |
nw_protocol_copy_tls_definition()
[@function] nw_protocol_copy_tls_definition
|
static NSObject |
nw_protocol_copy_udp_definition()
[@function] nw_protocol_copy_udp_definition
|
static NSObject |
nw_protocol_copy_ws_definition()
[@function] nw_protocol_copy_ws_definition
|
static boolean |
nw_protocol_definition_is_equal(NSObject definition1,
NSObject definition2)
[@function] nw_protocol_definition_is_equal
|
static NSObject |
nw_protocol_metadata_copy_definition(NSObject metadata)
[@function] nw_protocol_metadata_copy_definition
|
static boolean |
nw_protocol_metadata_is_framer_message(NSObject metadata)
[@function] nw_protocol_metadata_is_framer_message
|
static boolean |
nw_protocol_metadata_is_ip(NSObject metadata)
[@function] nw_protocol_metadata_is_ip
|
static boolean |
nw_protocol_metadata_is_quic(NSObject metadata)
[@function] nw_protocol_metadata_is_quic
|
static boolean |
nw_protocol_metadata_is_tcp(NSObject metadata)
[@function] nw_protocol_metadata_is_tcp
|
static boolean |
nw_protocol_metadata_is_tls(NSObject metadata)
[@function] nw_protocol_metadata_is_tls
|
static boolean |
nw_protocol_metadata_is_udp(NSObject metadata)
[@function] nw_protocol_metadata_is_udp
|
static boolean |
nw_protocol_metadata_is_ws(NSObject metadata)
[@function] nw_protocol_metadata_is_ws
|
static NSObject |
nw_protocol_options_copy_definition(NSObject options)
[@function] nw_protocol_options_copy_definition
|
static boolean |
nw_protocol_options_is_quic(NSObject options)
[@function] nw_protocol_options_is_quic
|
static void |
nw_protocol_stack_clear_application_protocols(NSObject stack)
[@function] nw_protocol_stack_clear_application_protocols
|
static NSObject |
nw_protocol_stack_copy_internet_protocol(NSObject stack)
[@function] nw_protocol_stack_copy_internet_protocol
|
static NSObject |
nw_protocol_stack_copy_transport_protocol(NSObject stack)
[@function] nw_protocol_stack_copy_transport_protocol
|
static void |
nw_protocol_stack_iterate_application_protocols(NSObject stack,
Network.Block_nw_protocol_stack_iterate_application_protocols iterate_block)
[@function] nw_protocol_stack_iterate_application_protocols
|
static void |
nw_protocol_stack_prepend_application_protocol(NSObject stack,
NSObject protocol)
[@function] nw_protocol_stack_prepend_application_protocol
|
static void |
nw_protocol_stack_set_transport_protocol(NSObject stack,
NSObject protocol)
[@function] nw_protocol_stack_set_transport_protocol
|
static void |
nw_quic_add_tls_application_protocol(NSObject options,
java.lang.String application_protocol)
[@function] nw_quic_add_tls_application_protocol
|
static NSObject |
nw_quic_copy_sec_protocol_metadata(NSObject metadata)
[@function] nw_quic_copy_sec_protocol_metadata
|
static NSObject |
nw_quic_copy_sec_protocol_options(NSObject options)
[@function] nw_quic_copy_sec_protocol_options
|
static NSObject |
nw_quic_create_options()
[@function] nw_quic_create_options
|
static java.lang.String |
nw_quic_get_application_error_reason(NSObject metadata)
[@function] nw_quic_get_application_error_reason
|
static long |
nw_quic_get_application_error(NSObject metadata)
[@function] nw_quic_get_application_error
|
static int |
nw_quic_get_idle_timeout(NSObject options)
[@function] nw_quic_get_idle_timeout
|
static long |
nw_quic_get_initial_max_data(NSObject options)
[@function] nw_quic_get_initial_max_data
|
static long |
nw_quic_get_initial_max_stream_data_bidirectional_local(NSObject options)
[@function] nw_quic_get_initial_max_stream_data_bidirectional_local
|
static long |
nw_quic_get_initial_max_stream_data_bidirectional_remote(NSObject options)
[@function] nw_quic_get_initial_max_stream_data_bidirectional_remote
|
static long |
nw_quic_get_initial_max_stream_data_unidirectional(NSObject options)
[@function] nw_quic_get_initial_max_stream_data_unidirectional
|
static long |
nw_quic_get_initial_max_streams_bidirectional(NSObject options)
[@function] nw_quic_get_initial_max_streams_bidirectional
|
static long |
nw_quic_get_initial_max_streams_unidirectional(NSObject options)
[@function] nw_quic_get_initial_max_streams_unidirectional
|
static char |
nw_quic_get_keepalive_interval(NSObject metadata)
[@function] nw_quic_get_keepalive_interval
|
static long |
nw_quic_get_local_max_streams_bidirectional(NSObject metadata)
[@function] nw_quic_get_local_max_streams_bidirectional
|
static long |
nw_quic_get_local_max_streams_unidirectional(NSObject metadata)
[@function] nw_quic_get_local_max_streams_unidirectional
|
static char |
nw_quic_get_max_udp_payload_size(NSObject options)
[@function] nw_quic_get_max_udp_payload_size
|
static long |
nw_quic_get_remote_idle_timeout(NSObject metadata)
[@function] nw_quic_get_remote_idle_timeout
|
static long |
nw_quic_get_remote_max_streams_bidirectional(NSObject metadata)
[@function] nw_quic_get_remote_max_streams_bidirectional
|
static long |
nw_quic_get_remote_max_streams_unidirectional(NSObject metadata)
[@function] nw_quic_get_remote_max_streams_unidirectional
|
static long |
nw_quic_get_stream_application_error(NSObject metadata)
[@function] nw_quic_get_stream_application_error
|
static long |
nw_quic_get_stream_id(NSObject metadata)
[@function] nw_quic_get_stream_id
|
static boolean |
nw_quic_get_stream_is_unidirectional(NSObject options)
[@function] nw_quic_get_stream_is_unidirectional
|
static void |
nw_quic_set_application_error(NSObject metadata,
long application_error,
java.lang.String reason)
[@function] nw_quic_set_application_error
|
static void |
nw_quic_set_idle_timeout(NSObject options,
int idle_timeout)
[@function] nw_quic_set_idle_timeout
|
static void |
nw_quic_set_initial_max_data(NSObject options,
long initial_max_data)
[@function] nw_quic_set_initial_max_data
|
static void |
nw_quic_set_initial_max_stream_data_bidirectional_local(NSObject options,
long initial_max_stream_data_bidirectional_local)
[@function] nw_quic_set_initial_max_stream_data_bidirectional_local
|
static void |
nw_quic_set_initial_max_stream_data_bidirectional_remote(NSObject options,
long initial_max_stream_data_bidirectional_remote)
[@function] nw_quic_set_initial_max_stream_data_bidirectional_remote
|
static void |
nw_quic_set_initial_max_stream_data_unidirectional(NSObject options,
long initial_max_stream_data_unidirectional)
[@function] nw_quic_set_initial_max_stream_data_unidirectional
|
static void |
nw_quic_set_initial_max_streams_bidirectional(NSObject options,
long initial_max_streams_bidirectional)
[@function] nw_quic_set_initial_max_streams_bidirectional
|
static void |
nw_quic_set_initial_max_streams_unidirectional(NSObject options,
long initial_max_streams_unidirectional)
[@function] nw_quic_set_initial_max_streams_unidirectional
|
static void |
nw_quic_set_keepalive_interval(NSObject metadata,
char keepalive_interval)
[@function] nw_quic_set_keepalive_interval
|
static void |
nw_quic_set_local_max_streams_bidirectional(NSObject metadata,
long max_streams_bidirectional)
[@function] nw_quic_set_local_max_streams_bidirectional
|
static void |
nw_quic_set_local_max_streams_unidirectional(NSObject metadata,
long max_streams_unidirectional)
[@function] nw_quic_set_local_max_streams_unidirectional
|
static void |
nw_quic_set_max_udp_payload_size(NSObject options,
char max_udp_payload_size)
[@function] nw_quic_set_max_udp_payload_size
|
static void |
nw_quic_set_stream_application_error(NSObject metadata,
long application_error)
[@function] nw_quic_set_stream_application_error
|
static void |
nw_quic_set_stream_is_unidirectional(NSObject options,
boolean is_unidirectional)
[@function] nw_quic_set_stream_is_unidirectional
|
static NSObject |
nw_resolution_report_copy_preferred_endpoint(NSObject resolution_report)
[@function] nw_resolution_report_copy_preferred_endpoint
|
static NSObject |
nw_resolution_report_copy_successful_endpoint(NSObject resolution_report)
[@function] nw_resolution_report_copy_successful_endpoint
|
static int |
nw_resolution_report_get_endpoint_count(NSObject resolution_report)
[@function] nw_resolution_report_get_endpoint_count
|
static long |
nw_resolution_report_get_milliseconds(NSObject resolution_report)
[@function] nw_resolution_report_get_milliseconds
|
static int |
nw_resolution_report_get_protocol(NSObject resolution_report)
[@function] nw_resolution_report_get_protocol
|
static int |
nw_resolution_report_get_source(NSObject resolution_report)
[@function] nw_resolution_report_get_source
|
static void |
nw_resolver_config_add_server_address(NSObject config,
NSObject server_address)
[@function] nw_resolver_config_add_name_server
|
static NSObject |
nw_resolver_config_create_https(NSObject url_endpoint)
[@function] nw_resolver_config_create_https
|
static NSObject |
nw_resolver_config_create_tls(NSObject server_endpoint)
[@function] nw_resolver_config_create_tls
|
static NSObject |
nw_tcp_create_options()
[@function] nw_tcp_create_options
|
static int |
nw_tcp_get_available_receive_buffer(NSObject metadata)
[@function] nw_tcp_get_available_receive_buffer
|
static int |
nw_tcp_get_available_send_buffer(NSObject metadata)
[@function] nw_tcp_get_available_send_buffer
|
static void |
nw_tcp_options_set_connection_timeout(NSObject options,
int connection_timeout)
[@function] nw_tcp_options_set_connection_timeout
|
static void |
nw_tcp_options_set_disable_ack_stretching(NSObject options,
boolean disable_ack_stretching)
[@function] nw_tcp_options_set_disable_ack_stretching
|
static void |
nw_tcp_options_set_disable_ecn(NSObject options,
boolean disable_ecn)
[@function] nw_tcp_options_set_disable_ecn
|
static void |
nw_tcp_options_set_enable_fast_open(NSObject options,
boolean enable_fast_open)
[@function] nw_tcp_options_set_enable_fast_open
|
static void |
nw_tcp_options_set_enable_keepalive(NSObject options,
boolean enable_keepalive)
[@function] nw_tcp_options_set_enable_keepalive
|
static void |
nw_tcp_options_set_keepalive_count(NSObject options,
int keepalive_count)
[@function] nw_tcp_options_set_keepalive_count
|
static void |
nw_tcp_options_set_keepalive_idle_time(NSObject options,
int keepalive_idle_time)
[@function] nw_tcp_options_set_keepalive_idle_time
|
static void |
nw_tcp_options_set_keepalive_interval(NSObject options,
int keepalive_interval)
[@function] nw_tcp_options_set_keepalive_interval
|
static void |
nw_tcp_options_set_maximum_segment_size(NSObject options,
int maximum_segment_size)
[@function] nw_tcp_options_set_maximum_segment_size
|
static void |
nw_tcp_options_set_multipath_force_version(NSObject options,
int multipath_force_version)
[@function] nw_tcp_options_set_multipath_force_version
|
static void |
nw_tcp_options_set_no_delay(NSObject options,
boolean no_delay)
[@function] nw_tcp_options_set_no_delay
|
static void |
nw_tcp_options_set_no_options(NSObject options,
boolean no_options)
[@function] nw_tcp_options_set_no_options
|
static void |
nw_tcp_options_set_no_push(NSObject options,
boolean no_push)
[@function] nw_tcp_options_set_no_push
|
static void |
nw_tcp_options_set_persist_timeout(NSObject options,
int persist_timeout)
[@function] nw_tcp_options_set_persist_timeout
|
static void |
nw_tcp_options_set_retransmit_connection_drop_time(NSObject options,
int retransmit_connection_drop_time)
[@function] nw_tcp_options_set_retransmit_connection_drop_time
|
static void |
nw_tcp_options_set_retransmit_fin_drop(NSObject options,
boolean retransmit_fin_drop)
[@function] nw_tcp_options_set_retransmit_fin_drop
|
static NSObject |
nw_tls_copy_sec_protocol_metadata(NSObject metadata)
[@function] nw_tls_copy_sec_protocol_metadata
|
static NSObject |
nw_tls_copy_sec_protocol_options(NSObject options)
[@function] nw_tls_copy_sec_protocol_options
|
static NSObject |
nw_tls_create_options()
[@function] nw_tls_create_options
|
static boolean |
nw_txt_record_access_bytes(NSObject txt_record,
Network.Block_nw_txt_record_access_bytes access_bytes)
[@function] nw_txt_record_access_bytes
|
static boolean |
nw_txt_record_access_key(NSObject txt_record,
java.lang.String key,
Network.Block_nw_txt_record_access_key access_value)
[@function] nw_txt_record_access_key
|
static boolean |
nw_txt_record_apply(NSObject txt_record,
Network.Block_nw_txt_record_apply applier)
[@function] nw_txt_record_apply
|
static NSObject |
nw_txt_record_copy(NSObject txt_record)
[@function] nw_txt_record_copy
|
static NSObject |
nw_txt_record_create_dictionary()
[@function] nw_txt_record_create_dictionary
|
static NSObject |
nw_txt_record_create_with_bytes(java.lang.String txt_bytes,
long txt_len)
[@function] nw_txt_record_create_with_bytes
|
static int |
nw_txt_record_find_key(NSObject txt_record,
java.lang.String key)
[@function] nw_txt_record_find_key
|
static long |
nw_txt_record_get_key_count(NSObject txt_record)
[@function] nw_txt_record_get_key_count
|
static boolean |
nw_txt_record_is_dictionary(NSObject txt_record)
[@function] nw_txt_record_is_dictionary
|
static boolean |
nw_txt_record_is_equal(NSObject left,
NSObject right)
[@function] nw_txt_record_is_equal
|
static boolean |
nw_txt_record_remove_key(NSObject txt_record,
java.lang.String key)
[@function] nw_txt_record_remove_key
|
static boolean |
nw_txt_record_set_key(NSObject txt_record,
java.lang.String key,
java.lang.String value,
long value_len)
[@function] nw_txt_record_set_key
|
static NSObject |
nw_udp_create_metadata()
[@function] nw_udp_create_metadata
|
static NSObject |
nw_udp_create_options()
[@function] nw_udp_create_options
|
static void |
nw_udp_options_set_prefer_no_checksum(NSObject options,
boolean prefer_no_checksum)
[@function] nw_udp_options_set_prefer_no_checksum
|
static NSObject |
nw_ws_create_metadata(int opcode)
[@function] nw_ws_create_metadata
|
static NSObject |
nw_ws_create_options(int version)
[@function] nw_ws_create_options
|
static NSObject |
nw_ws_metadata_copy_server_response(NSObject metadata)
[@function] nw_ws_metadata_copy_server_response
|
static int |
nw_ws_metadata_get_close_code(NSObject metadata)
[@function] nw_ws_metadata_get_close_code
|
static int |
nw_ws_metadata_get_opcode(NSObject metadata)
[@function] nw_ws_metadata_get_opcode
|
static void |
nw_ws_metadata_set_close_code(NSObject metadata,
int close_code)
[@function] nw_ws_metadata_set_close_code
|
static void |
nw_ws_metadata_set_pong_handler(NSObject metadata,
NSObject client_queue,
Network.Block_nw_ws_metadata_set_pong_handler pong_handler)
[@function] nw_ws_metadata_set_pong_handler
|
static void |
nw_ws_options_add_additional_header(NSObject options,
java.lang.String name,
java.lang.String value)
[@function] nw_ws_options_add_additional_header
|
static void |
nw_ws_options_add_subprotocol(NSObject options,
java.lang.String subprotocol)
[@function] nw_ws_options_add_subprotocol
|
static void |
nw_ws_options_set_auto_reply_ping(NSObject options,
boolean auto_reply_ping)
[@function] nw_ws_options_set_auto_reply_ping
|
static void |
nw_ws_options_set_client_request_handler(NSObject options,
NSObject client_queue,
Network.Block_nw_ws_options_set_client_request_handler handler)
[@typedef] nw_ws_options_set_client_request_handler
|
static void |
nw_ws_options_set_maximum_message_size(NSObject options,
long maximum_message_size)
[@function] nw_ws_options_set_maximum_message_size
|
static void |
nw_ws_options_set_skip_handshake(NSObject options,
boolean skip_handshake)
[@function] nw_ws_options_set_skip_handshake
|
static boolean |
nw_ws_request_enumerate_additional_headers(NSObject request,
Network.Block_nw_ws_request_enumerate_additional_headers enumerator)
[@function] nw_ws_request_enumerate_additional_headers
|
static boolean |
nw_ws_request_enumerate_subprotocols(NSObject request,
Network.Block_nw_ws_request_enumerate_subprotocols enumerator)
[@function] nw_ws_request_enumerate_subprotocols
|
static void |
nw_ws_response_add_additional_header(NSObject response,
java.lang.String name,
java.lang.String value)
[@function] nw_ws_response_add_additional_header
|
static NSObject |
nw_ws_response_create(int status,
java.lang.String selected_subprotocol)
[@function] nw_ws_response_create
|
static boolean |
nw_ws_response_enumerate_additional_headers(NSObject response,
Network.Block_nw_ws_response_enumerate_additional_headers enumerator)
[@function] nw_ws_response_enumerate_additional_headers
|
static java.lang.String |
nw_ws_response_get_selected_subprotocol(NSObject response)
[@function] nw_ws_response_get_selected_subprotocol
|
static int |
nw_ws_response_get_status(NSObject response)
[@function] nw_ws_response_get_status
|
public static NSObject nw_txt_record_create_with_bytes(java.lang.String txt_bytes, long txt_len)
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.
txt_bytes - The pointer to the buffer.txt_len - The length of the buffer.public static NSObject nw_txt_record_create_dictionary()
Create an empty TXT record dictionary.
public static NSObject nw_txt_record_copy(NSObject txt_record)
Create a deep copy of an existing TXT record object.
txt_record - The TXT record object to be copied.public static int nw_txt_record_find_key(NSObject txt_record, java.lang.String key)
Find a key-value pair in the TXT record object.
txt_record - The TXT record object.key - The key of the key-value pair.public static boolean nw_txt_record_access_key(NSObject txt_record, java.lang.String key, Network.Block_nw_txt_record_access_key access_value)
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.
txt_record - The TXT record object.access_value - The block that will be used to access the value of the given key.public static boolean nw_txt_record_set_key(NSObject txt_record, java.lang.String key, java.lang.String value, long value_len)
Set a key-value pair on the TXT record object.
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.public static boolean nw_txt_record_remove_key(NSObject txt_record, java.lang.String key)
Removes a key-value pair in the TXT record object given its key.
txt_record - The TXT record object.key - The key corresponding to the key-value pair.public static long nw_txt_record_get_key_count(NSObject txt_record)
Count the number of keys in the TXT record object.
txt_record - A TXT record object.public static boolean nw_txt_record_access_bytes(NSObject txt_record, Network.Block_nw_txt_record_access_bytes access_bytes)
Access the raw TXT record inside the TXT record object.
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.public static boolean nw_txt_record_apply(NSObject txt_record, Network.Block_nw_txt_record_apply applier)
Apply the block to every key-value pair in the TXT record object.
txt_record - The TXT record object.applier - The block that will be applied to the entire TXT record object.public static boolean nw_txt_record_is_equal(NSObject left, NSObject right)
Check if the two TXT record objects are equal.
left - The first TXT record object to be compared.right - The second TXT record object to be compared.public static boolean nw_txt_record_is_dictionary(NSObject txt_record)
Check whether the TXT record is a dictionary or a buffer.
txt_record - The TXT record object.public static NSObject nw_advertise_descriptor_create_bonjour_service(java.lang.String name, java.lang.String type, java.lang.String domain)
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.
name - An optional Bonjour service name.type - A Bonjour service type.domain - An optional Bonjour service domain.public static void nw_advertise_descriptor_set_txt_record(NSObject advertise_descriptor, org.moe.natj.general.ptr.ConstVoidPtr txt_record, long txt_length)
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.
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.public static void nw_advertise_descriptor_set_no_auto_rename(NSObject advertise_descriptor, boolean no_auto_rename)
Disable auto-rename for the Bonjour service registration. Auto-rename is enabled by default.
advertise_descriptor - The advertise descriptor to modify.no_auto_rename - A boolean indicating if auto-rename should be disabled.public static boolean nw_advertise_descriptor_get_no_auto_rename(NSObject advertise_descriptor)
Check if auto-rename has been disabled for the Bonjour service registration.
advertise_descriptor - The advertise descriptor object.public static void nw_advertise_descriptor_set_txt_record_object(NSObject advertise_descriptor, NSObject txt_record)
Set the TXT record object on the advertise descriptor.
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.public static NSObject nw_advertise_descriptor_copy_txt_record_object(NSObject advertise_descriptor)
Copies the TXT record object from the advertise descriptor.
advertise_descriptor - The advertise descriptor object.public static boolean nw_protocol_definition_is_equal(NSObject definition1, NSObject definition2)
Compare two protocol definitions to check if they represent the same protocol.
definition1 - The first definition to comparedefinition2 - The second definition to comparepublic static NSObject nw_protocol_options_copy_definition(NSObject options)
Retrieve the protocol definition for a given options object.
options - The protocol options to checkpublic static NSObject nw_protocol_metadata_copy_definition(NSObject metadata)
Retrieve the protocol definition for a given metadata object.
metadata - The protocol metadata to checkpublic static int nw_interface_get_type(NSObject interface_)
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.
interface - The interface object to check.public static java.lang.String nw_interface_get_name(NSObject interface_)
Retrieves the name of an interface, to be used for reference or logging purposes.
interface - The interface object to check.public static int nw_interface_get_index(NSObject interface_)
Retrieves the index of an interface, to be used for reference or logging purposes. This is the same value as provided by if_nametoindex.
interface - The interface object to check.public static int nw_endpoint_get_type(NSObject endpoint)
Retrieves the type of a network endpoint.
endpoint - The endpoint object for which to get the type.public static NSObject nw_endpoint_create_host(java.lang.String hostname, java.lang.String port)
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.
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".public static java.lang.String nw_endpoint_get_hostname(NSObject endpoint)
Retrieves the hostname string for a network endpoint with the type nw_endpoint_type_host or nw_endpoint_type_url.
endpoint - The endpoint object.public static org.moe.natj.general.ptr.BytePtr nw_endpoint_copy_port_string(NSObject endpoint)
Returns an allocated port string for a network endpoint with the type nw_endpoint_type_host or nw_endpoint_type_address.
endpoint - The endpoint object.public static char nw_endpoint_get_port(NSObject endpoint)
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.
endpoint - The endpoint object.public static NSObject nw_endpoint_create_address(sockaddr address)
Creates a network endpoint with a sockaddr struct. The endpoint will have the type nw_endpoint_type_address.
address - An address stored as a sockaddr.public static org.moe.natj.general.ptr.BytePtr nw_endpoint_copy_address_string(NSObject endpoint)
Returns an allocated IP address string for a network endpoint with the type nw_endpoint_type_address.
endpoint - The endpoint object.public static sockaddr nw_endpoint_get_address(NSObject endpoint)
Retrieves the sockaddr struct for a network endpoint with the type nw_endpoint_type_address.
endpoint - The endpoint object.public static NSObject nw_endpoint_create_bonjour_service(java.lang.String name, java.lang.String type, java.lang.String domain)
Creates a network endpoint for a Bonjour Service name, type, and domain. The endpoint will have the type nw_endpoint_type_bonjour_service.
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".public static java.lang.String nw_endpoint_get_bonjour_service_name(NSObject endpoint)
Retrieves the Bonjour Service name string for a network endpoint with the type nw_endpoint_type_bonjour_service.
endpoint - The endpoint object.public static java.lang.String nw_endpoint_get_bonjour_service_type(NSObject endpoint)
Retrieves the Bonjour Service type string for a network endpoint with the type nw_endpoint_type_bonjour_service.
endpoint - The endpoint object.public static java.lang.String nw_endpoint_get_bonjour_service_domain(NSObject endpoint)
Retrieves the Bonjour Service domain string for a network endpoint with the type nw_endpoint_type_bonjour_service.
endpoint - The endpoint object.public static NSObject nw_endpoint_create_url(java.lang.String url)
Creates a network endpoint with a URL. The endpoint will have the type nw_endpoint_type_url.
url - The URL string.public static java.lang.String nw_endpoint_get_url(NSObject endpoint)
Retrieves the URL string from a network endpoint of type nw_endpoint_type_url.
endpoint - The endpoint object.public static NSObject nw_parameters_create_secure_tcp(Network.Block_nw_parameters_create_secure_tcp_0 configure_tls, Network.Block_nw_parameters_create_secure_tcp_1 configure_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.
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.public static NSObject nw_parameters_create_secure_udp(Network.Block_nw_parameters_create_secure_udp_0 configure_dtls, Network.Block_nw_parameters_create_secure_udp_1 configure_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.
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.public static NSObject 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().
public static NSObject nw_parameters_copy(NSObject parameters)
Creates a deep copy of a parameters object that can be modified.
parameters - The existing parameters object to copypublic static void nw_parameters_require_interface(NSObject parameters, NSObject interface_)
Require any connections or listeners using these parameters to use the provided network interface, or none if NULL is passed.
parameters - The parameters object to configureinterface - The interface to require for connections or listeners, or NULL to
allow any interface.public static NSObject nw_parameters_copy_required_interface(NSObject parameters)
Access the required network interface set on the parameters.
parameters - The parameters object to checkpublic static void nw_parameters_prohibit_interface(NSObject parameters, NSObject interface_)
Prohibit any connections or listeners using these parameters from using the provided network interface.
parameters - The parameters object to configureinterface - The interface to prohibit for connections or listeners.public static void nw_parameters_clear_prohibited_interfaces(NSObject parameters)
Clear any interfaces that had been prohibited.
parameters - The parameters object to modifypublic static void nw_parameters_iterate_prohibited_interfaces(NSObject parameters, Network.Block_nw_parameters_iterate_prohibited_interfaces iterate_block)
List all prohibited network interfaces.
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.public static void nw_parameters_set_required_interface_type(NSObject parameters, int interface_type)
Require any connections or listeners using these parameters to use the provided network interface type.
parameters - The parameters object to configureinterface_type - The interface type to require for connections or listeners.public static int nw_parameters_get_required_interface_type(NSObject parameters)
Access the required network interface type set on the parameters.
parameters - The parameters object to checkpublic static void nw_parameters_prohibit_interface_type(NSObject parameters, int interface_type)
Prohibit any connections or listeners using these parameters from using the provided network interface type.
parameters - The parameters object to configureinterface_type - The interface type to prohibit for connections or listeners.public static void nw_parameters_clear_prohibited_interface_types(NSObject parameters)
Clear any interface types that had been prohibited.
parameters - The parameters object to modifypublic static void nw_parameters_iterate_prohibited_interface_types(NSObject parameters, Network.Block_nw_parameters_iterate_prohibited_interface_types iterate_block)
List all prohibited network interface types.
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.public static void nw_parameters_set_prohibit_expensive(NSObject parameters, boolean prohibit_expensive)
Prohibit any connections or listeners using these parameters from using a network interface that is considered expensive by the system.
parameters - The parameters object to configureprohibit_expensive - If true, prohibit the use of any expensive interfaces. If false,
allow expensive interfaces. Defaults to false.public static boolean nw_parameters_get_prohibit_expensive(NSObject parameters)
Check if the parameters prohibit expensive interfaces.
parameters - The parameters object to checkpublic static void nw_parameters_set_prohibit_constrained(NSObject parameters, boolean prohibit_constrained)
Prohibit any connections or listeners using these parameters from using a network interface that is considered constrained by the system.
parameters - The parameters object to configureprohibit_constrained - If true, prohibit the use of any constrained interfaces. If false,
allow constrained interfaces. Defaults to false.public static boolean nw_parameters_get_prohibit_constrained(NSObject parameters)
Check if the parameters prohibit constrained interfaces.
parameters - The parameters object to checkpublic static void nw_parameters_set_reuse_local_address(NSObject parameters, boolean reuse_local_address)
Allow any connections using these parameters to reuse local addresses already in use by other connections.
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.public static boolean nw_parameters_get_reuse_local_address(NSObject parameters)
Check if the parameters allow local address reuse.
parameters - The parameters object to checkpublic static void nw_parameters_set_local_endpoint(NSObject parameters, NSObject 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 - The parameters object to configurelocal_endpoint - The endpoint to set as the local endpoint. Pass NULL to
clear the local endpoint.public static NSObject nw_parameters_copy_local_endpoint(NSObject parameters)
Extract the local endpoint set on the connection.
parameters - The parameters object to configurepublic static void nw_parameters_set_include_peer_to_peer(NSObject parameters, boolean 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 - The parameters object to configureinclude_peer_to_peer - If true, allow advertising, resolving, and connecting over
peer-to-peer interfaces. Defaults to false.public static boolean nw_parameters_get_include_peer_to_peer(NSObject parameters)
Check if the parameters allow the inclusion of peer-to-peer interfaces.
parameters - The parameters object to checkpublic static void nw_parameters_set_fast_open_enabled(NSObject parameters, boolean 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 - 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.public static boolean nw_parameters_get_fast_open_enabled(NSObject parameters)
Check if the parameters allow the use of fast open for the top level protocol.
parameters - The parameters object to checkpublic static void nw_parameters_set_service_class(NSObject parameters, int service_class)
Set the data service class to use for connections.
parameters - The parameters object to configureservice_class - The service class value to use for connections. Defaults to nw_service_class_best_effort.public static int nw_parameters_get_service_class(NSObject parameters)
Check the service class configured on the parameters.
parameters - The parameters object to checkpublic static void nw_parameters_set_multipath_service(NSObject parameters, int multipath_service)
Set the multipath service to use for connections.
parameters - The parameters object to configuremultipath_service - The multipath service value to use for connections. Defaults to nw_multipath_service_disabled.public static int nw_parameters_get_multipath_service(NSObject parameters)
Check the multipath service mode configured on the parameters.
parameters - The parameters object to checkpublic static NSObject nw_parameters_copy_default_protocol_stack(NSObject parameters)
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 - The parameters object to checkpublic static void nw_protocol_stack_prepend_application_protocol(NSObject stack, NSObject protocol)
Prepend an application-layer protocol onto the top of a protocol stack.
stack - The protocol stack to modifyprotocol - The protocol options to add to the stack, which contain the definition of the
protocol to add.public static void nw_protocol_stack_clear_application_protocols(NSObject stack)
Remove all application-layer protocols from a protocol stack.
stack - The protocol stack to modifypublic static void nw_protocol_stack_iterate_application_protocols(NSObject stack, Network.Block_nw_protocol_stack_iterate_application_protocols iterate_block)
List all application protocols attached to a protocol stack.
stack - The protocol stack to checkiterate_block - A block that will return the protocols attached to the stack.public static NSObject nw_protocol_stack_copy_transport_protocol(NSObject stack)
Access the transport-layer protocol used in a protocol stack.
stack - The protocol stack to checkpublic static void nw_protocol_stack_set_transport_protocol(NSObject stack, NSObject protocol)
Set the transport-layer protocol to use for a protocol stack.
stack - The protocol stack to modifyprotocol - The protocol options to set into the stack, which contain the definition of the
protocol.public static NSObject nw_protocol_stack_copy_internet_protocol(NSObject stack)
Access the internet-layer protocol used in a protocol stack.
stack - The protocol stack to checkpublic static void nw_parameters_set_local_only(NSObject parameters, boolean local_only)
Set to true to limit inbound connections to peers attached to the local link only. Defaults to false.
parameters - The parameters object to configurelocal_only - True to limit connections to the local link only.public static boolean nw_parameters_get_local_only(NSObject parameters)
Indicates whether or not the parameters limit connections to the local link only.
parameters - The parameters object to checkpublic static void nw_parameters_set_prefer_no_proxy(NSObject parameters, boolean 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 - The parameters to modify.prefer_no_proxy - True to cause connections to be attempted without proxies.public static boolean nw_parameters_get_prefer_no_proxy(NSObject parameters)
Indicates whether or not the parameters cause connections to be attempted without proxies, only using proxies if connections cannot otherwise be completed.
parameters - The parameters to get the property from.public static void nw_parameters_set_expired_dns_behavior(NSObject parameters, int 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 - The parameters to modify.expired_dns_behavior - Allow, prohibit, or use system default behavior for expired DNS answers.public static int nw_parameters_get_expired_dns_behavior(NSObject parameters)
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 - The parameters to check.public static NSObject nw_browse_descriptor_create_bonjour_service(java.lang.String type, java.lang.String domain)
Creates a new browse descriptor object on a Bonjour service type and domain.
type - A Bonjour service type.domain - An optional Bonjour service domain. If the domain is unspecified, the
default domains for browsing will be used.public static java.lang.String nw_browse_descriptor_get_bonjour_service_type(NSObject descriptor)
Returns the service type of a browse descriptor.
descriptor - A browse descriptor object.public static java.lang.String nw_browse_descriptor_get_bonjour_service_domain(NSObject descriptor)
Returns the service domain of a browse descriptor, or NULL if NULL was provided while creating the descriptor.
descriptor - A browse descriptor object.public static void nw_browse_descriptor_set_include_txt_record(NSObject descriptor, boolean 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.
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.public static boolean nw_browse_descriptor_get_include_txt_record(NSObject descriptor)
Check whether the browser is allowed to query for TXT records.
descriptor - The browse descriptor to check.public static NSObject nw_browse_result_copy_endpoint(NSObject result)
Copies the endpoint associated with the browse result object.
result - The browse result object.public static long nw_browse_result_get_changes(NSObject old_result, NSObject new_result)
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.
old_result - The old result.new_result - The new result.public static long nw_browse_result_get_interfaces_count(NSObject result)
Returns the number of interfaces on this browse result.
result - The browse result object.public static NSObject nw_browse_result_copy_txt_record_object(NSObject result)
Copies the TXT record object from the browse result.
result - The browse result object.public static void nw_browse_result_enumerate_interfaces(NSObject result, Network.Block_nw_browse_result_enumerate_interfaces enumerator)
Enumerates the list of interfaces on this browse result.
result - The browse result object.enumerator - The enumerator block.public static int nw_error_get_error_domain(NSObject error)
Given a reference to a nw_error, returns the error domain.
[@returns] The error domain.
error - A reference to the nw_error.public static int nw_error_get_error_code(NSObject error)
Given a reference to a nw_error, returns the error code.
[@returns] The error code.
error - A reference to the nw_error.public static CFErrorRef nw_error_copy_cf_error(NSObject 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.
error - A reference to the nw_error.public static NSObject nw_browser_create(NSObject descriptor, NSObject parameters)
Creates a new browser object, which can be used to browse for results matching a browse descriptor.
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.public static void nw_browser_set_queue(NSObject browser, NSObject queue)
Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_browser_start().
browser - The browser object.queue - The client's callback queue.public static void nw_browser_set_browse_results_changed_handler(NSObject browser, Network.Block_nw_browser_set_browse_results_changed_handler 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.
browser - The browser object.handler - The callback handler that fires when the browser gets an update for a
changed browse result.public static void nw_browser_set_state_changed_handler(NSObject browser, Network.Block_nw_browser_set_state_changed_handler 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.
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.public static void nw_browser_start(NSObject browser)
Starts the browser, which begins browsing for available endpoints. You must call nw_browser_set_queue() before starting the browser.
browser - The browser object.public static void nw_browser_cancel(NSObject browser)
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.
browser - The browser object.public static NSObject nw_browser_copy_parameters(NSObject browser)
Returns a copy of the parameters passed to nw_browser_create().
browser - The browser object.public static NSObject nw_browser_copy_browse_descriptor(NSObject browser)
Returns a copy of the browse_descriptor passed to nw_browser_create().
browser - The browser object.public static int nw_path_get_status(NSObject path)
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.
path - The path object to check.public static void nw_path_enumerate_interfaces(NSObject path, Network.Block_nw_path_enumerate_interfaces enumerate_block)
List all interfaces associated with the path.
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.public static boolean nw_path_is_equal(NSObject path, NSObject other_path)
Compares two network path objects and checks if their content is equal. If they are not equal, they represent two different network states.
path - The first path object to compare.other_path - The second path object to compare.public static boolean nw_path_is_expensive(NSObject path)
Checks if the path uses any network interfaces that are considered expensive to the user, such as, but not limited to, a cellular network.
path - The path object to check.public static boolean nw_path_is_constrained(NSObject path)
Checks if the path uses any network interfaces that are considered constrained to the user.
path - The path object to check.public static boolean nw_path_has_ipv4(NSObject path)
Checks if the path uses a network interface that supports IPv4 connectivity.
path - The path object to check.public static boolean nw_path_has_ipv6(NSObject path)
Checks if the path uses a network interface that supports IPv6 connectivity.
path - The path object to check.public static boolean nw_path_has_dns(NSObject path)
Checks if the path has a DNS server configuration set.
path - The path object to check.public static boolean nw_path_uses_interface_type(NSObject path, int interface_type)
Checks if the path uses a network interface with the specified type.
path - The path object to check.public static NSObject nw_path_copy_effective_local_endpoint(NSObject path)
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.
path - The path object to check.public static NSObject nw_path_copy_effective_remote_endpoint(NSObject path)
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.
path - The path object to check.public static void nw_path_enumerate_gateways(NSObject path, Network.Block_nw_path_enumerate_gateways enumerate_block)
List the IP addresses of the routers acting as the gateways for the path.
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.public static NSObject nw_content_context_create(java.lang.String context_identifier)
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.
context_identifier - A string description of the contextpublic static java.lang.String nw_content_context_get_identifier(NSObject context)
Access the identifier description.
public static boolean nw_content_context_get_is_final(NSObject context)
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.
context - The context objectpublic static void nw_content_context_set_is_final(NSObject context, boolean 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.
context - The context objectis_final - If set to true, mark the context as the final context to send on a connection.public static long nw_content_context_get_expiration_milliseconds(NSObject context)
Retrieve the number of milliseconds after which the content will expire. See nw_content_context_set_expiration_milliseconds for further discussion.
context - The context objectpublic static void nw_content_context_set_expiration_milliseconds(NSObject context, long 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().
context - The context objectexpiration_milliseconds - The number of milliseconds after which content will expirepublic static double nw_content_context_get_relative_priority(NSObject context)
Get the relative priority for the content. See nw_content_context_set_relative_priority for further discussion.
context - The context objectpublic static void nw_content_context_set_relative_priority(NSObject context, double 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.
context - The context objectrelative_priority - The relative priority of the content, between
0.0 (lowest priority) to 1.0 (highest priority).public static void nw_content_context_set_antecedent(NSObject context, NSObject antecedent_context)
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.
context - The context objectantecedent_context - A context associated with content that should precede
this content.public static NSObject nw_content_context_copy_antecedent(NSObject context)
Copy the optional content context that must be sent prior to this content. See nw_content_context_set_antecedent for further discussion.
context - The context objectpublic static void nw_content_context_set_metadata_for_protocol(NSObject context, NSObject protocol_metadata)
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.
context - The context context parent objectprotocol_metadata - The per-protocol metadata context object to setpublic static NSObject nw_content_context_copy_protocol_metadata(NSObject context, NSObject protocol)
Copy the per-protocol metadata from a parent content context
context - The context context parent objectprotocol - The definition identifier of the protocol to retrieve metadata forpublic static void nw_content_context_foreach_protocol_metadata(NSObject context, Network.Block_nw_content_context_foreach_protocol_metadata foreach_block)
Access all per-protocol metadata objects from a parent content context
context - The context context parent objectforeach_block - A block in which protocol definition and metadata will be sentpublic static NSObject nw_connection_create(NSObject endpoint, NSObject parameters)
Creates a networking connection to an endpoint.
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.public static NSObject nw_connection_copy_endpoint(NSObject connection)
Retrieves the remote endpoint for a connection.
connection - The connection object.public static NSObject nw_connection_copy_parameters(NSObject connection)
Retrieves the parameters for a connection.
connection - The connection object.public static void nw_connection_set_state_changed_handler(NSObject connection, Network.Block_nw_connection_set_state_changed_handler 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.
connection - The connection object.handler - The state changed handler to call when the connection state changes.
Pass NULL to remove the state changed handler.public static void nw_connection_set_viability_changed_handler(NSObject connection, Network.Block_nw_connection_set_viability_changed_handler 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.
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.public static void nw_connection_set_better_path_available_handler(NSObject connection, Network.Block_nw_connection_set_better_path_available_handler 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.
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.public static void nw_connection_set_path_changed_handler(NSObject connection, Network.Block_nw_connection_set_path_changed_handler handler)
Define a callback to be fired when the connection's path changes.
connection - The connection object.handler - The event handler to call when the connection's path changes.
Pass NULL to remove the event handler.public static void nw_connection_set_queue(NSObject connection, NSObject queue)
Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_connection_start().
connection - The connection object.queue - The client's dispatch queue.public static void nw_connection_start(NSObject connection)
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.
connection - The connection object.public static void nw_connection_restart(NSObject connection)
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.
connection - The connection object.public static void nw_connection_cancel(NSObject connection)
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.
connection - The connection object.public static void nw_connection_force_cancel(NSObject connection)
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.
connection - The connection object.public static void nw_connection_cancel_current_endpoint(NSObject connection)
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.
connection - The connection object.public static void nw_connection_receive(NSObject connection, int minimum_incomplete_length, int maximum_length, Network.Block_nw_connection_receive completion)
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.
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.public static void nw_connection_receive_message(NSObject connection, Network.Block_nw_connection_receive_message completion)
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.
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.public static void nw_connection_send(NSObject connection, NSObject content, NSObject context, boolean is_complete, Network.Block_nw_connection_send completion)
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.
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.public static void nw_connection_batch(NSObject connection, Network.Block_nw_connection_batch batch_block)
Batch several send and/or receive operations together, to hint to the connection that multiple send or receive operations are expected in quick succession.
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.public static org.moe.natj.general.ptr.BytePtr nw_connection_copy_description(NSObject connection)
Copy a human-readable description of the connection.
connection - The connection object.public static NSObject nw_connection_copy_current_path(NSObject connection)
Copy the current path for a connection. If a connection is established, this will reflect the connected path.
connection - The connection object.public static NSObject nw_connection_copy_protocol_metadata(NSObject connection, NSObject definition)
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.
connection - The connection object.definition - The protocol definition for which metadata will be returned.public static int nw_connection_get_maximum_datagram_size(NSObject connection)
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.
connection - The connection object.public static void nw_connection_access_establishment_report(NSObject connection, NSObject queue, Network.Block_nw_connection_access_establishment_report access_block)
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.
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.public static long nw_establishment_report_get_duration_milliseconds(NSObject report)
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.
report - An establishment report.public static long nw_establishment_report_get_attempt_started_after_milliseconds(NSObject report)
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.
report - An establishment report.public static int nw_establishment_report_get_previous_attempt_count(NSObject report)
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.
report - An establishment report.public static boolean nw_establishment_report_get_used_proxy(NSObject report)
Check if the connection used a proxy during establishment.
report - An establishment report.public static boolean nw_establishment_report_get_proxy_configured(NSObject report)
Check if a proxy configuration applied to the connection, even if the connection did not end up using a proxy for the successful attempt.
report - An establishment report.public static NSObject nw_establishment_report_copy_proxy_endpoint(NSObject report)
Access the endpoint of the proxy used by a connection, if applicable.
report - An establishment report.public static void nw_establishment_report_enumerate_resolutions(NSObject report, Network.Block_nw_establishment_report_enumerate_resolutions enumerate_block)
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.
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.
public static void nw_establishment_report_enumerate_protocols(NSObject report, Network.Block_nw_establishment_report_enumerate_protocols enumerate_block)
Enumerate the protocols used in the established connection. The provided block will be called inline zero or more times.
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.
public static NSObject nw_connection_create_new_data_transfer_report(NSObject connection)
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.
connection - A connection object, in or before the ready state.public static int nw_data_transfer_report_get_state(NSObject report)
Access the state of a data transfer report. Once a report is "collected", individual fields may be read.
report - A data transfer report to check.public static void nw_data_transfer_report_collect(NSObject report, NSObject queue, Network.Block_nw_data_transfer_report_collect collect_block)
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.
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.public static long nw_data_transfer_report_get_duration_milliseconds(NSObject report)
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.
report - A data transfer report in the "collected" state.public static int nw_data_transfer_report_get_path_count(NSObject report)
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.
report - A data transfer report in the "collected" state.public static long nw_data_transfer_report_get_received_ip_packet_count(NSObject report, int path_index)
Retrieve the number of IP packets received on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_sent_ip_packet_count(NSObject report, int path_index)
Retrieve the number of IP packets sent on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_received_transport_byte_count(NSObject report, int path_index)
Retrieve the number of transport protocol bytes (such as TCP stream bytes) received on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_received_transport_duplicate_byte_count(NSObject report, int path_index)
Retrieve the number of duplicate transport protocol bytes (such as duplicate TCP bytes) received on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_received_transport_out_of_order_byte_count(NSObject report, int path_index)
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.
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.public static long nw_data_transfer_report_get_sent_transport_byte_count(NSObject report, int path_index)
Retrieve the number of transport protocol bytes (such as TCP stream bytes) sent on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_sent_transport_retransmitted_byte_count(NSObject report, int path_index)
Retrieve the number of retransmitted transport protocol bytes (such as retransmitted TCP bytes) sent on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_transport_smoothed_rtt_milliseconds(NSObject report, int path_index)
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.
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.public static long nw_data_transfer_report_get_transport_minimum_rtt_milliseconds(NSObject report, int path_index)
Retrieve the minimum (best) round trip time (RTT) on a given path for the duration of the report, measured in milliseconds.
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.public static long nw_data_transfer_report_get_transport_rtt_variance(NSObject report, int path_index)
Retrieve the variance of the round trip time (RTT) on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_received_application_byte_count(NSObject report, int path_index)
Retrieve the number of application bytes received on a given path for the duration of the report.
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.public static long nw_data_transfer_report_get_sent_application_byte_count(NSObject report, int path_index)
Retrieve the number of application bytes sent on a given path for the duration of the report.
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.public static NSObject nw_data_transfer_report_copy_path_interface(NSObject report, int path_index)
Retrieve the interface used for data transfer for a given path used by a connection.
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.public static NSObject nw_framer_protocol_create_message(NSObject definition)
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.
definition - The framer protocol definition, as retrieved from
nw_protocol_options_copy_definition() on the framer options.public static boolean nw_protocol_metadata_is_framer_message(NSObject metadata)
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.
metadata - The protocol metadata to check.public static NSObject nw_framer_message_create(NSObject framer)
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.
framer - The framer instance object.public static void nw_framer_message_set_value(NSObject message, java.lang.String key, org.moe.natj.general.ptr.VoidPtr value, Network.Block_nw_framer_message_set_value dispose_value)
Set a key-value pair on a framer message, with a custom dispose function for the value.
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.public static boolean nw_framer_message_access_value(NSObject message, java.lang.String key, Network.Block_nw_framer_message_access_value access_value)
Access the value with a key on a framer message.
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.public static void nw_framer_message_set_object_value(NSObject message, java.lang.String key, java.lang.Object value)
Set a key-value pair on a framer message, where the value is a reference-counted object.
message - The framer message object.key - The string key to identify the value.value - A reference counted object to store.public static java.lang.Object nw_framer_message_copy_object_value(NSObject message, java.lang.String key)
Copy the stored object value using a key on a framer message.
message - The framer message object.key - The string key to identify the value.public static NSObject nw_framer_create_definition(java.lang.String identifier, int flags, Network.Block_nw_framer_create_definition start_handler)
Create a protocol definition for a custom framer protocol.
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.public static NSObject nw_framer_create_options(NSObject framer_definition)
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.
framer_definition - A protocol definition created with nw_framer_create_definition().public static void nw_framer_set_input_handler(NSObject framer, Network.Block_nw_framer_set_input_handler 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.
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.public static void nw_framer_set_output_handler(NSObject framer, Network.Block_nw_framer_set_output_handler 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.
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.public static void nw_framer_set_wakeup_handler(NSObject framer, Network.Block_nw_framer_set_wakeup_handler 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.
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.public static void nw_framer_set_stop_handler(NSObject framer, Network.Block_nw_framer_set_stop_handler 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.
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.public static void nw_framer_set_cleanup_handler(NSObject framer, Network.Block_nw_framer_set_cleanup_handler 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.
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.public static void nw_framer_mark_ready(NSObject framer)
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().
framer - The framer instance object.public static boolean nw_framer_prepend_application_protocol(NSObject framer, NSObject protocol_options)
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().
framer - The framer instance object.protocol_options - Protocol options for an application protocol to dynamically
add "above" the framer.public static void nw_framer_mark_failed_with_error(NSObject framer, int error_code)
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().
framer - The framer instance object.error_code - An error code to describe why the connection failed.public static boolean nw_framer_parse_input(NSObject framer, long minimum_incomplete_length, long maximum_length, org.moe.natj.general.ptr.BytePtr temp_buffer, Network.Block_nw_framer_parse_input parse)
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().
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.public static void nw_framer_deliver_input(NSObject framer, java.lang.String input_buffer, long input_length, NSObject message, boolean is_complete)
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().
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.public static boolean nw_framer_deliver_input_no_copy(NSObject framer, long input_length, NSObject message, boolean is_complete)
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().
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.public static void nw_framer_pass_through_input(NSObject framer)
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().
framer - The framer instance object.public static boolean nw_framer_parse_output(NSObject framer, long minimum_incomplete_length, long maximum_length, org.moe.natj.general.ptr.BytePtr temp_buffer, Network.Block_nw_framer_parse_output parse)
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().
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.public static void nw_framer_write_output(NSObject framer, java.lang.String output_buffer, long output_length)
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().
framer - The framer instance object.output_buffer - The bytes to write.output_length - The length of output_buffer.public static void nw_framer_write_output_data(NSObject framer, NSObject 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().
framer - The framer instance object.output_data - A dispatch_data_t to write.public static boolean nw_framer_write_output_no_copy(NSObject framer, long output_length)
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().
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.public static void nw_framer_pass_through_output(NSObject framer)
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().
framer - The framer instance object.public static void nw_framer_schedule_wakeup(NSObject framer, long milliseconds)
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().
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.public static void nw_framer_async(NSObject framer, Network.Block_nw_framer_async async_block)
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.
framer - The framer instance object.async_block - A block to execute on the correct scheduling context for the
framer instance.public static NSObject nw_framer_copy_remote_endpoint(NSObject framer)
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().
framer - The framer instance.public static NSObject nw_framer_copy_local_endpoint(NSObject framer)
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().
framer - The framer instance.public static NSObject nw_framer_copy_parameters(NSObject framer)
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().
framer - The framer instance.public static NSObject 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.
public static void nw_ip_options_set_version(NSObject options, int 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.
options - An IP protocol options object.version - A specific, restricted IP version.public static void nw_ip_options_set_hop_limit(NSObject options, byte hop_limit)
Configure the IP hop limit (or 'TTL' for IPv4).
options - An IP protocol options object.hop_limit - The hop limit to set on outgoing IP packets.public static void nw_ip_options_set_use_minimum_mtu(NSObject options, boolean use_minimum_mtu)
Configure IP to use the minimum MTU value, which is 1280 bytes for IPv6. This value has no effect for IPv4.
options - An IP protocol options object.use_minimum_mtu - A boolean indicating that the IP should use
its minimum MTU value.public static void nw_ip_options_set_disable_fragmentation(NSObject options, boolean disable_fragmentation)
Configure IP to disable fragmentation on outgoing packets.
options - An IP protocol options object.disable_fragmentation - A boolean indicating that the IP should use
disable fragmentation on outgoing packets.public static void nw_ip_options_set_calculate_receive_time(NSObject options, boolean calculate_receive_time)
Configure IP to calculate receive time for inbound packets.
options - An IP protocol options object.calculate_receive_time - A boolean indicating that the IP packets
should mark their receive time in IP metadata.public static void nw_ip_options_set_local_address_preference(NSObject options, int preference)
Specify a preference for how to select local addresses for outbound connections.
options - An IP protocol options object.preference - Preference for how to select local addresses.public static NSObject 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.
public static boolean nw_protocol_metadata_is_ip(NSObject metadata)
Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of IP.
public static void nw_ip_metadata_set_ecn_flag(NSObject metadata, int ecn_flag)
Sets ECN flags on IP metadata. This will take effect if applied to any sent content.
metadata - An IP metadata object.ecn_flag - The ECN flag to apply to packets.public static int nw_ip_metadata_get_ecn_flag(NSObject metadata)
Gets ECN flags from IP metadata. This will be set only for metadata associated with received content.
metadata - An IP metadata object.public static void nw_ip_metadata_set_service_class(NSObject metadata, int 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.
metadata - An IP metadata object.service_class - The service class to apply to packets.public static int nw_ip_metadata_get_service_class(NSObject metadata)
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.
metadata - An IP metadata object.public static long nw_ip_metadata_get_receive_time(NSObject metadata)
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().
metadata - An IP metadata object.public static NSObject nw_listener_create_with_port(java.lang.String port, NSObject parameters)
Creates a networking listener bound to a specified local port.
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.public static NSObject nw_listener_create(NSObject parameters)
Creates a networking listener. The listener will be assigned a random port upon which to listen unless otherwise specified by the parameters.
parameters - The parameters to use for the listener. These include the protocols to be
used for the listener.public static NSObject nw_listener_create_with_connection(NSObject connection, NSObject parameters)
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).
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.public static void nw_listener_set_queue(NSObject listener, NSObject queue)
Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_listener_start().
listener - The listener object.queue - The client's dispatch queue.public static void nw_listener_set_state_changed_handler(NSObject listener, Network.Block_nw_listener_set_state_changed_handler 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.
listener - The listener object.handler - The state changed handler to call when the listener state changes.
Pass NULL to remove the event handler.public static void nw_listener_set_new_connection_handler(NSObject listener, Network.Block_nw_listener_set_new_connection_handler handler)
Sets the client new connection handler. Must be called before nw_listener_start.
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.public static int nw_listener_get_new_connection_limit(NSObject listener)
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.
listener - The listener object.public static void nw_listener_set_new_connection_limit(NSObject listener, int 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.
listener - The listener object.new_connection_limit - The new connection limit. Pass NW_LISTENER_INFINITE_CONNECTION_LIMIT
to disable new connection limiting.public static void nw_listener_set_advertise_descriptor(NSObject listener, NSObject 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.
listener - The listener object.advertise_descriptor - The advertise_descriptor or NULL to prevent or remove registration of a service.public static void nw_listener_set_advertised_endpoint_changed_handler(NSObject listener, Network.Block_nw_listener_set_advertised_endpoint_changed_handler handler)
Sets the client advertised endpoint changed handler. The handler will be invoked for listeners which have called nw_listener_set_advertise_descriptor().
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.public static char nw_listener_get_port(NSObject listener)
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.
listener - The listener to get the local port of.public static void nw_listener_start(NSObject listener)
Starts the listener, which will cause the listener to start listening for inbound connections.
listener - The listener object.public static void nw_listener_cancel(NSObject listener)
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.
listener - The listener object.public static NSObject nw_path_monitor_create()
Create a default path monitor, that will allow the enumeration of all available interfaces on the system.
public static NSObject nw_path_monitor_create_with_type(int required_interface_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.
required_interface_type - An interface type that will filter any results that the path monitor returns.public static void nw_path_monitor_set_cancel_handler(NSObject monitor, Network.Block_nw_path_monitor_set_cancel_handler 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.
monitor - The path monitor object.cancel_handler - The block to call upon cancellation. Pass NULL to remove the cancel handler.public static void nw_path_monitor_set_update_handler(NSObject monitor, Network.Block_nw_path_monitor_set_update_handler 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.
monitor - The path monitor object.update_handler - The block to call when the path changes.public static void nw_path_monitor_set_queue(NSObject monitor, NSObject queue)
Sets the client update queue. All blocks will be scheduled on this queue. Call before calling nw_path_monitor_start.
monitor - The path monitor object.queue - The dispatch queue on which to call the update and cancel handlers.public static void nw_path_monitor_start(NSObject monitor)
Starts the path monitor.
monitor - The path monitor object.public static void nw_path_monitor_cancel(NSObject monitor)
Cancel the path monitor.
monitor - The path monitor object.public static NSObject 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.
public static NSObject 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.
public static void nw_tcp_options_set_no_delay(NSObject options, boolean no_delay)
Configure TCP to disable Nagle's algorithm, which will delay sending packets to coalesce sending.
options - A TCP protocol options object.no_delay - A boolean indicating that TCP should disable
Nagle's algorithm.public static void nw_tcp_options_set_no_push(NSObject options, boolean no_push)
Wait to send TCP data until the connection has finished writing, or else the TCP send buffer is full.
options - A TCP protocol options object.no_push - A boolean indicating that TCP should be set into
no-push mode.public static void nw_tcp_options_set_no_options(NSObject options, boolean no_options)
Disable sending TCP options and extensions.
options - A TCP protocol options object.no_options - A boolean indicating that TCP should be set into
no-options mode.public static void nw_tcp_options_set_enable_keepalive(NSObject options, boolean enable_keepalive)
Enable sending TCP keepalive probes.
options - A TCP protocol options object.enable_keepalive - A boolean indicating that TCP should send keepalives.public static void nw_tcp_options_set_keepalive_count(NSObject options, int keepalive_count)
Configure the number of times TCP keepalive probes should be sent without reply before terminating the connection.
options - A TCP protocol options object.keepalive_count - The number of keepalive probes to send before terminating
the connection.public static void nw_tcp_options_set_keepalive_idle_time(NSObject options, int keepalive_idle_time)
Configure the amount of time that a connection must be idle before TCP should start sending keepalive probes.
options - A TCP protocol options object.keepalive_idle_time - The number of seconds of idleness to wait before keepalive
probes are sent by TCP.public static void nw_tcp_options_set_keepalive_interval(NSObject options, int keepalive_interval)
Configure the amount of time between sending TCP keepalive probes when the peer is not responding.
options - A TCP protocol options object.keepalive_interval - The number of seconds of to wait before resending TCP
keepalive probes.public static void nw_tcp_options_set_maximum_segment_size(NSObject options, int maximum_segment_size)
Directly configure the maximum segment size (MSS) TCP will use.
options - A TCP protocol options object.maximum_segment_size - The maximum segment size in bytes.public static void nw_tcp_options_set_connection_timeout(NSObject options, int connection_timeout)
Define a timeout value after which TCP connection establishment will give up.
options - A TCP protocol options object.connection_timeout - A timeout for TCP connection establishment, in seconds.public static void nw_tcp_options_set_persist_timeout(NSObject options, int persist_timeout)
Define a timeout value after which TCP connections in the persist state will terminate. See RFC 6429.
options - A TCP protocol options object.persist_timeout - The TCP persist timeout, in seconds.public static void nw_tcp_options_set_retransmit_connection_drop_time(NSObject options, int retransmit_connection_drop_time)
Define a timeout value after which TCP will drop a connection with unacknowledged retransmissions.
options - A TCP protocol options object.retransmit_connection_drop_time - A timeout for TCP retransmission attempts, in seconds.public static void nw_tcp_options_set_retransmit_fin_drop(NSObject options, boolean retransmit_fin_drop)
Cause TCP to drop connections after not receiving an ACK multiple times after a FIN, currently set at three.
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.public static void nw_tcp_options_set_disable_ack_stretching(NSObject options, boolean disable_ack_stretching)
Configure TCP to disable ACK stretching. ACKs will be sent for every other data packet.
options - A TCP protocol options object.disable_ack_stretching - A boolean to cause TCP to disable ACK stretching.public static void nw_tcp_options_set_enable_fast_open(NSObject options, boolean 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().
options - A TCP protocol options object.enable_fast_open - A boolean to enable TFO.public static void nw_tcp_options_set_disable_ecn(NSObject options, boolean disable_ecn)
Configure TCP to disable default Explicit Congestion Notification (ECN) behavior.
options - A TCP protocol options object.disable_ecn - A boolean to disable ECN support in TCP.public static boolean nw_protocol_metadata_is_tcp(NSObject metadata)
Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of TCP.
public static int nw_tcp_get_available_receive_buffer(NSObject metadata)
Fetch the number of bytes waiting to be read from the receive buffer.
public static int nw_tcp_get_available_send_buffer(NSObject metadata)
Fetch the number of bytes waiting to be acknowledged in the send buffer.
public static NSObject 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.
public static NSObject 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.
public static NSObject nw_tls_copy_sec_protocol_options(NSObject options)
Access the sec_protocol_options_t for a given network protocol
options instance. See
options - An nw_protocol_options_t that has been created for TLS.public static boolean nw_protocol_metadata_is_tls(NSObject metadata)
Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of TLS.
public static NSObject nw_tls_copy_sec_protocol_metadata(NSObject metadata)
Access the sec_protocol_metadata_t for a given network protocol
metadata instance. See
metadata - An nw_protocol_metadata_t for the TLS protocol.public static NSObject 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.
public static NSObject 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.
public static void nw_udp_options_set_prefer_no_checksum(NSObject options, boolean prefer_no_checksum)
Configure UDP to skip computing checksums when sending. This will only take effect when running over IPv4.
options - A UDP protocol options object.prefer_no_checksum - A boolean that indicates if UDP is allowed to skip computing
its checksum.public static NSObject 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.
public static boolean nw_protocol_metadata_is_udp(NSObject metadata)
Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of UDP.
public static NSObject 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.
public static NSObject nw_ws_create_options(int version)
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.
public static void nw_ws_options_add_additional_header(NSObject options, java.lang.String name, java.lang.String value)
Set additional HTTP headers to be sent by the client during the WebSocket handshake.
options - The WebSocket protocol options object.name - The HTTP header name.value - The HTTP header value.public static void nw_ws_options_add_subprotocol(NSObject options, java.lang.String subprotocol)
Add to the list of subprotocols that will be presented to a WebSocket server during connection establishment.
options - The WebSocket protocol options object.subprotocol - The subprotocol supported by the client.public static void nw_ws_options_set_auto_reply_ping(NSObject options, boolean auto_reply_ping)
Set whether the WebSocket connection should automatically reply to all incoming pings.
options - The WebSocket protocol options object.auto_reply_ping - Whether the WebSocket connection should automatically reply to all
incoming pings.public static void nw_ws_options_set_skip_handshake(NSObject options, boolean skip_handshake)
Set whether the WebSocket protocol should skip the opening handshake and begin framing data as soon as a connection is established.
options - The WebSocket protocol options object.skip_handshake - Whether the WebSocket connection should skip the opening handshake.public static void nw_ws_options_set_maximum_message_size(NSObject options, long maximum_message_size)
Set the maximum allowed message size to be received by the WebSocket connection. This does not limit the sending message size.
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.public static boolean nw_protocol_metadata_is_ws(NSObject metadata)
Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of WebSocket.
public static NSObject nw_ws_create_metadata(int opcode)
Creates a protocol metadata object that can be used to define the content context of messages sent over a WebSocket connection.
opcode - Set the opcode on a WebSocket frame. This must be defined on create.public static int nw_ws_metadata_get_opcode(NSObject metadata)
Get the opcode on a WebSocket frame.
metadata - The metadata object representing the WebSocket frame.public static void nw_ws_metadata_set_close_code(NSObject metadata, int close_code)
Set the close code on a WebSocket frame. The WebSocket frame's opcode should be nw_ws_opcode_close.
metadata - The metadata object representing the WebSocket frame.close_code - The close code on the WebSocket frame.public static int nw_ws_metadata_get_close_code(NSObject metadata)
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.
metadata - The metadata object representing the WebSocket frame.public static void nw_ws_metadata_set_pong_handler(NSObject metadata, NSObject client_queue, Network.Block_nw_ws_metadata_set_pong_handler 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.
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.public static boolean nw_ws_request_enumerate_subprotocols(NSObject request, Network.Block_nw_ws_request_enumerate_subprotocols enumerator)
Enumerates the list of subprotocols on the client's request.
request - The client request.enumerator - The enumerator block.public static boolean nw_ws_request_enumerate_additional_headers(NSObject request, Network.Block_nw_ws_request_enumerate_additional_headers enumerator)
Enumerates the list of additional headers on the client's request.
request - The client request.enumerator - The enumerator block.public static NSObject nw_ws_response_create(int status, java.lang.String selected_subprotocol)
Create a server response to a WebSocket client's opening handshake.
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.public static int nw_ws_response_get_status(NSObject response)
Get the status from a WebSocket server's response. If the response is nil, the return value will be nw_ws_response_status_invalid.
response - The server response.public static java.lang.String nw_ws_response_get_selected_subprotocol(NSObject response)
Get the selected subprotocol from a WebSocket server's response.
response - The server response.public static void nw_ws_response_add_additional_header(NSObject response, java.lang.String name, java.lang.String value)
Add additional HTTP headers to be sent back to the WebSocket client in the server's response.
response - The server response.name - The HTTP name.value - The HTTP value.public static NSObject nw_ws_metadata_copy_server_response(NSObject metadata)
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.
metadata - The metadata object representing the WebSocket connection.public static boolean nw_ws_response_enumerate_additional_headers(NSObject response, Network.Block_nw_ws_response_enumerate_additional_headers enumerator)
Enumerates the list of additional headers on the server's response.
response - The server response.enumerator - The enumerator block.public static void nw_ws_options_set_client_request_handler(NSObject options, NSObject client_queue, Network.Block_nw_ws_options_set_client_request_handler handler)
Set callback handler to be invoked when a WebSocket server receives a WebSocket client's request to connect.
options - The protocol options object.client_queue - The queue on which the client request handler will be delivered.handler - The callback handler.public static CFStringRef kNWErrorDomainPOSIX()
public static CFStringRef kNWErrorDomainDNS()
public static CFStringRef kNWErrorDomainTLS()
public static NSObject _nw_content_context_default_message()
public static NSObject _nw_content_context_final_send()
public static NSObject _nw_content_context_default_stream()
public static int _nw_data_transfer_report_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.
public static NSObject nw_resolver_config_create_https(NSObject url_endpoint)
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.
url_endpoint - The URL template of the DoH server as an endpoint.public static NSObject nw_resolver_config_create_tls(NSObject server_endpoint)
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.
server_endpoint - A host endpoint identifying the DoT server.public static void nw_resolver_config_add_server_address(NSObject config, NSObject server_address)
Modifies the resolver configuration by adding a DNS server address as an endpoint.
config - A resolver config object.server_address - A server address to assign to the configuration, as an endpoint.public static NSObject nw_privacy_context_create(java.lang.String description)
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.
description - A string description used for logging.public static void nw_privacy_context_flush_cache(NSObject privacy_context)
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.
privacy_context - A privacy context to flush.public static void nw_privacy_context_disable_logging(NSObject privacy_context)
Disable logging for connections and listeners associated with this context. Logging may not be disabled on the default privacy context.
privacy_context - A privacy context on which to disable logging.public static void nw_privacy_context_require_encrypted_name_resolution(NSObject privacy_context, boolean require_encrypted_name_resolution, NSObject fallback_resolver_config)
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.
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.public static void nw_parameters_set_privacy_context(NSObject parameters, NSObject 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 - The parameters object to configureprivacy_context - The privacy context to associate with connections and listeners that use
these parameters.public static NSObject nw_group_descriptor_create_multicast(NSObject multicast_group)
Creates a new group descriptor object based on a multicast group, represented as an address endpoint.
multicast_group - An address endpoint that contains a multicast group to join.public static boolean nw_group_descriptor_add_endpoint(NSObject descriptor, NSObject endpoint)
Add an additional endpoint to a given group descriptor.
descriptor - A group descriptor.endpoint - An endpoint to add to the group.public static void nw_group_descriptor_enumerate_endpoints(NSObject descriptor, Network.Block_nw_group_descriptor_enumerate_endpoints enumerate_block)
List all endpoints associated with the group descriptor.
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.public static void nw_multicast_group_descriptor_set_specific_source(NSObject multicast_descriptor, NSObject source)
Require a particular source for this multicast group descriptor.
multicast_descriptor - The multicast group descriptor to modify.source - An endpoint describing the source for this descriptor.public static void nw_multicast_group_descriptor_set_disable_unicast_traffic(NSObject multicast_descriptor, boolean disable_unicast_traffic)
Disable receiving unicast traffic for a connection group that is also receiving multicast traffic.
multicast_descriptor - The multicast group descriptor to modify.disable_unicast_traffic - A boolean indicating if receiving unicast traffic should be disabled.public static boolean nw_multicast_group_descriptor_get_disable_unicast_traffic(NSObject multicast_descriptor)
Check if receiving unicast traffic has been disabled for a multicast connection group.
multicast_descriptor - The multicast group descriptor to check.public static NSObject nw_connection_group_create(NSObject group_descriptor, NSObject parameters)
Creates a new connection group object to use for communication with a group descriptor using protocols described by 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.public static NSObject nw_connection_group_copy_descriptor(NSObject group)
Gets the group descriptor with which the connection group was created.
group - The connection group to check.public static NSObject nw_connection_group_copy_parameters(NSObject group)
Returns a copy of the parameters passed to nw_connection_group_create.
group - The connection group object.public static void nw_connection_group_set_queue(NSObject group, NSObject queue)
Sets the client callback queue, on which blocks for events will be scheduled. This must be done before calling nw_connection_group_start().
group - The connection group object.queue - The client's callback queue.public static void nw_connection_group_set_state_changed_handler(NSObject group, Network.Block_nw_connection_group_set_state_changed_handler 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.
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.public static void nw_connection_group_set_receive_handler(NSObject group, int maximum_message_size, boolean reject_oversized_messages, Network.Block_nw_connection_group_set_receive_handler 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.
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.public static void nw_connection_group_start(NSObject group)
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.
group - The connection group object.public static void nw_connection_group_cancel(NSObject group)
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.
group - The connection group object.public static NSObject nw_connection_group_copy_remote_endpoint_for_message(NSObject group, NSObject context)
Copy the remote endpoint corresponding to a given inbound connection group message.
group - The connection group object.context - A content context representing an inbound message received from this connection group.public static NSObject nw_connection_group_copy_local_endpoint_for_message(NSObject group, NSObject context)
Copy the local endpoint corresponding to a given inbound connection group message.
group - The connection group object.context - A content context representing an inbound message received from this connection group.public static NSObject nw_connection_group_copy_path_for_message(NSObject group, NSObject context)
Copy the path associated with a given inbound connection group message.
group - The connection group object.context - A content context representing an inbound message received from this connection group.public static void nw_connection_group_reply(NSObject group, NSObject inbound_message, NSObject outbound_message, NSObject content)
Send data in response to an inbound message received by a connection group.
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.public static NSObject nw_connection_group_extract_connection_for_message(NSObject group, NSObject context)
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.
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.public static void nw_connection_group_send_message(NSObject group, NSObject content, NSObject endpoint, NSObject context, Network.Block_nw_connection_group_send_message completion)
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.
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.public static int nw_resolution_report_get_source(NSObject resolution_report)
Check the source of a resolution, such as query or cache.
resolution_report - A resolution report.public static long nw_resolution_report_get_milliseconds(NSObject resolution_report)
Get the number of milliseconds spent on this resolution step.
resolution_report - A resolution report.public static int nw_resolution_report_get_endpoint_count(NSObject resolution_report)
Get the number of resolved endpoints discovered by the resolution step.
resolution_report - A resolution report.public static NSObject nw_resolution_report_copy_successful_endpoint(NSObject resolution_report)
Copy the resolved endpoint that led to a successful connection.
resolution_report - A resolution report.public static NSObject nw_resolution_report_copy_preferred_endpoint(NSObject resolution_report)
Copy first resolved endpoint attempted, which may be the same as the successful endpoint.
resolution_report - A resolution report.public static int nw_resolution_report_get_protocol(NSObject resolution_report)
Check the protocol used for endpoint resolution.
resolution_report - A resolution report.public static void nw_establishment_report_enumerate_resolution_reports(NSObject report, Network.Block_nw_establishment_report_enumerate_resolution_reports enumerate_block)
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.
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.
public static void nw_ip_options_set_disable_multicast_loopback(NSObject options, boolean 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.
options - An IP protocol options object.disable_multicast_loopback - If multicast loopback should be disabled.public static void nw_path_monitor_prohibit_interface_type(NSObject monitor, int interface_type)
Prohibit this path monitor from using the provided network interface type. Call before calling nw_path_monitor_start.
monitor - The path monitor object.interface_type - The interface type to prohibit for the path monitor.public static NSObject _nw_privacy_context_default_context()
public static int nw_path_get_unsatisfied_reason(NSObject path)
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.
path - The path object to check.public static NSObject nw_parameters_create_quic(Network.Block_nw_parameters_create_quic configure_quic)
Creates a parameters object that is configured for QUIC. The caller must pass in a block to configure options.
configure_quic - A block to configure QUIC. The caller must pass a custom
block to configure the QUIC options.public static void nw_parameters_set_attribution(NSObject parameters, byte 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 - The parameters to modify.attribution - The entity to attribute the network operations to.public static byte nw_parameters_get_attribution(NSObject parameters)
Returns the attribution set on the parameters.
parameters - The parameters to check.public static NSObject nw_group_descriptor_create_multiplex(NSObject remote_endpoint)
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.
remote_endpoint - An endpoint that can be used for communication over a multiplexing protocol.public static NSObject nw_connection_group_copy_protocol_metadata_for_message(NSObject group, NSObject context, NSObject definition)
Copy the metadata corresponding to a given inbound connection group message.
group - The connection group object.definition - The protocol definition for which metadata will be returned.public static NSObject nw_connection_group_extract_connection(NSObject group, NSObject endpoint, NSObject protocol_options)
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.
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.public static boolean nw_connection_group_reinsert_extracted_connection(NSObject group, NSObject 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.
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.public static void nw_connection_group_set_new_connection_handler(NSObject group, Network.Block_nw_connection_group_set_new_connection_handler 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.
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.public static NSObject nw_connection_group_copy_protocol_metadata(NSObject group, NSObject definition)
Copy the metadata corresponding to a given inbound connection group message.
group - The connection group object.definition - The protocol definition for which metadata will be returned.public static int nw_data_transfer_report_get_path_radio_type(NSObject report, int path_index)
Retrieve the radio type used for data transfer for a given path used by a connection.
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.public static void nw_listener_set_new_connection_group_handler(NSObject listener, Network.Block_nw_listener_set_new_connection_group_handler 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.
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.public static NSObject 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.
public static NSObject 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.
public static boolean nw_protocol_options_is_quic(NSObject options)
Checks whether the given protocol options define a QUIC protocol.
public static void nw_quic_add_tls_application_protocol(NSObject options, java.lang.String application_protocol)
Adds an Application-Layer Protocol Negotiation (ALPN) value to present in the TLS handshake.
options - An nw_protocol_options_t for QUIC.public static NSObject nw_quic_copy_sec_protocol_options(NSObject options)
Access the sec_protocol_options_t for a given QUIC
options instance. See
options - An nw_protocol_options_t for QUIC.public static boolean nw_quic_get_stream_is_unidirectional(NSObject options)
Returns whether or not a QUIC stream is unidirectional.
options - An nw_protocol_options_t for a QUIC stream.public static void nw_quic_set_stream_is_unidirectional(NSObject options, boolean is_unidirectional)
Set whether or not a QUIC stream should be unidirectional.
options - An nw_protocol_options_t for a QUIC stream.is_unidirectional - True if the stream is unidirectional, false otherwise.public static long nw_quic_get_initial_max_data(NSObject options)
Get the initial_max_data transport parameter on a QUIC connection.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_initial_max_data(NSObject options, long 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.
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.public static char nw_quic_get_max_udp_payload_size(NSObject options)
Get the maximum length of a QUIC packet (UDP payload) that the client is willing to receive on a connection, in bytes.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_max_udp_payload_size(NSObject options, char 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.
options - An nw_protocol_options_t for QUIC.max_udp_payload_size - The max_udp_payload_size value, in bytes.public static int nw_quic_get_idle_timeout(NSObject options)
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.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_idle_timeout(NSObject options, int 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.
options - An nw_protocol_options_t for QUIC.idle_timeout - The idle_timeout value, in milliseconds.public static long nw_quic_get_initial_max_streams_bidirectional(NSObject options)
Get the initial value of maximum bidirectional streams that the peer can initiate on a QUIC connection.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_initial_max_streams_bidirectional(NSObject options, long initial_max_streams_bidirectional)
Set the initial value of maximum bidirectional streams that the peer can initiate on a QUIC connection.
options - An nw_protocol_options_t for QUIC.initial_max_streams_bidirectional - The initial value for the maximum concurrent bidirectional streams.public static long nw_quic_get_initial_max_streams_unidirectional(NSObject options)
Get the initial value of maximum unidirectional streams that the peer can initiate on a QUIC connection.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_initial_max_streams_unidirectional(NSObject options, long initial_max_streams_unidirectional)
Set the initial value of maximum unidirectional streams that the peer can initiate on a QUIC connection.
options - An nw_protocol_options_t for QUIC.initial_max_streams_unidirectional - The initial value for the maximum concurrent unidirectional streams.public static long nw_quic_get_initial_max_stream_data_bidirectional_local(NSObject options)
Get the initial_max_stream_data_bidi_local transport parameter on a QUIC connection.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_initial_max_stream_data_bidirectional_local(NSObject options, long initial_max_stream_data_bidirectional_local)
Set the initial_max_stream_data_bidi_local transport parameter on a QUIC connection.
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.public static long nw_quic_get_initial_max_stream_data_bidirectional_remote(NSObject options)
Get the initial_max_stream_data_bidi_remote transport parameter on a QUIC connection.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_initial_max_stream_data_bidirectional_remote(NSObject options, long initial_max_stream_data_bidirectional_remote)
Set the initial_max_stream_data_bidi_remote transport parameter on a QUIC connection.
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.public static long nw_quic_get_initial_max_stream_data_unidirectional(NSObject options)
Get the initial_max_stream_data_uni transport parameter on a QUIC connection.
options - An nw_protocol_options_t for QUIC.public static void nw_quic_set_initial_max_stream_data_unidirectional(NSObject options, long initial_max_stream_data_unidirectional)
Set the initial_max_stream_data_uni transport parameter on a QUIC connection.
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.public static boolean nw_protocol_metadata_is_quic(NSObject metadata)
Checks if a protocol metadata object is compatible with the accessors defined in this file for the default system implementation of QUIC.
public static NSObject nw_quic_copy_sec_protocol_metadata(NSObject metadata)
Access the sec_protocol_metadata_t for a given QUIC connection
metadata instance. See
Will be filled out on connected instances of QUIC for metadata
returned by nw_connection_copy_protocol_metadata.
metadata - An nw_protocol_metadata_t for QUIC.public static long nw_quic_get_stream_id(NSObject metadata)
Get the QUIC stream ID.
metadata - A nw_protocol_metadata_t for a QUIC stream.public static long nw_quic_get_stream_application_error(NSObject metadata)
Access the Application Error value received from the peer in a stream close message.
metadata - A nw_protocol_metadata_t for a QUIC stream.public static void nw_quic_set_stream_application_error(NSObject metadata, long application_error)
Set an Application Error value to send to the peer when the stream is closed.
metadata - A nw_protocol_metadata_t for a QUIC stream.application_error - An application-specific error code value.public static long nw_quic_get_local_max_streams_bidirectional(NSObject metadata)
Get the most recent value of the maximum number of bidirectional streams that the peer can create.
metadata - A nw_protocol_metadata_t for QUIC.public static void nw_quic_set_local_max_streams_bidirectional(NSObject metadata, long max_streams_bidirectional)
Sets the maximum number of bidirectional streams that the peer can create.
metadata - A nw_protocol_metadata_t for QUIC.max_streams_bidirectional - The new number of maximum bidirectional streams.public static long nw_quic_get_local_max_streams_unidirectional(NSObject metadata)
Get the most recent value of the maximum number of unidirectional streams that the peer can create.
metadata - A nw_protocol_metadata_t for QUIC.public static void nw_quic_set_local_max_streams_unidirectional(NSObject metadata, long max_streams_unidirectional)
Sets the maximum number of unidirectional streams that the peer can create.
metadata - A nw_protocol_metadata_t for QUIC.max_streams_unidirectional - The new number of maximum unidirectional streams.public static long nw_quic_get_remote_max_streams_bidirectional(NSObject metadata)
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.
metadata - A nw_protocol_metadata_t for QUIC.public static long nw_quic_get_remote_max_streams_unidirectional(NSObject metadata)
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.
metadata - A nw_protocol_metadata_t for QUIC.public static long nw_quic_get_application_error(NSObject metadata)
Access the Application Error value received from the peer in a connection close message.
metadata - A nw_protocol_metadata_t for QUIC.public static java.lang.String nw_quic_get_application_error_reason(NSObject metadata)
Access the Application Error reason string received from the peer in a connection close message.
metadata - A nw_protocol_metadata_t for QUIC.public static void nw_quic_set_application_error(NSObject metadata, long application_error, java.lang.String reason)
Set the Application Error value to send to the peer in a connection close message.
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.public static char nw_quic_get_keepalive_interval(NSObject metadata)
Retrieves the keep-alive interval set on a QUIC connection.
metadata - A nw_protocol_metadata_t for QUIC.public static void nw_quic_set_keepalive_interval(NSObject metadata, char 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.
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.public static long nw_quic_get_remote_idle_timeout(NSObject metadata)
Access the idle_timeout value in milliseconds received from the peer in the transport parameters.
metadata - A nw_protocol_metadata_t for QUIC.public static void nw_tcp_options_set_multipath_force_version(NSObject options, int multipath_force_version)
Configure MPTCP to use a specified MPTCP standard version. This ignores the cached value from MPTCP version discovery.
options - A TCP protocol options object.multipath_force_version - The MPTCP version.