Sets a handler that receives inbound connections.
SDKs
- iOS 12.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 12.0+
- watchOS 5.0+
Framework
- Network
Declaration
void nw_listener_set_new_connection_handler(nw _listener _t listener, nw _listener _new _connection _handler _t handler);
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.