Function

nw_listener_set_new_connection_handler(_:_:)

Sets a handler that receives inbound connections.

Declaration

func nw_listener_set_new_connection_handler(_ listener: nw_listener_t, _ handler: nw_listener_new_connection_handler_t?)

Discussion

Upon receiving a new connection, you should set update handlers on the connection and start it in order to accept it. If you want to reject the connection, cancel the connection.

See Also

Receiving Connections

typealias nw_listener_new_connection_handler_t

A handler that delivers inbound connections.

func nw_listener_set_new_connection_limit(nw_listener_t, UInt32)

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

func nw_listener_get_new_connection_limit(nw_listener_t) -> UInt32

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

var NW_LISTENER_INFINITE_CONNECTION_LIMIT: UInt32

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