Type Alias

nw_listener_t

An object you use to listen for incoming network connections.

Declaration

typedef NSObject<OS_nw_listener> *nw_listener_t;

Topics

Creating Listeners

nw_listener_create

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

nw_listener_create_with_port

Initializes a network listener with a specified local port.

nw_listener_create_with_connection

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

nw_listener_set_queue

Sets the queue on which all listener events are delivered.

nw_listener_start

Registers for listening for inbound connections.

nw_listener_get_port

The port on which the listener can accept connections.

nw_listener_cancel

Stops listening for inbound connections.

Receiving Connections

nw_listener_set_new_connection_handler

Sets a handler that receives inbound connections.

nw_listener_new_connection_handler_t

A handler that delivers inbound connections.

nw_listener_set_new_connection_limit

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

nw_listener_get_new_connection_limit

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

NW_LISTENER_INFINITE_CONNECTION_LIMIT

A static value that indicates that inbound connections should not be limited.

Advertising Bonjour Services

nw_listener_set_advertise_descriptor

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

nw_advertise_descriptor_t

A description used to advertise the Bonjour service that a listener provides.

nw_listener_set_advertised_endpoint_changed_handler

Sets a handler that receives updates for the service endpoint being advertised.

nw_listener_advertised_endpoint_changed_handler_t

A handler that indicates changes to the service endpoints being advertised as they are added and removed.

Handling State Updates

nw_listener_set_state_changed_handler

Sets a handler to receive listener state updates.

nw_listener_state_changed_handler_t

A handler that delivers listener state updates with associated errors.

nw_listener_state_t

States indicating whether a listener is able to accept incoming connections.

See Also

Connections and Listeners

Implementing netcat with Network Framework

Build a simple netcat tool that establishes network connections and transfers data.

nw_connection_t

A bidirectional data connection between a local endpoint and a remote endpoint.

nw_browser_t

An object you use to browse for available network services.

nw_ethernet_channel_t

An object you use to send and receive custom Ethernet frames.