Create a TCP connection.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
The remote endpoint to connect to.
A flag indicating if the TLS protocol should be used to secure the communication over the connection.
The TLS protocol parameters to use. If
trueand this parameter is nil then the default TLS parameters will be used.
An optional delegate object that conforms to the
NWTCPConnection object. The underlying connection is in the process of being established. You can observe the connection’s
state property using KVO to determine when the connection is successfully established or fails due to an error. For information about KVO, see Key-Value Observing Programming Guide.
This method provides a convenient way to create TCP connections from a Network Extension Provider. It is preferred over using the sockets API. For instance, the Tunnel Provider can use this method to create a secure TCP connection with the tunnel server that can be used to tunnel network data.