This convenience initializer can be used to create a new connection that wil only be connected if there exists a better path (as determined by the system) to the remote endpoint of the original connection.
- iOS 9.0+
- macOS 10.11+
An upgraded connection will be initialized using the same remote endpoint and set of parameters from the original connection. If the original connection becomes disconnected or cancelled, the new upgrade connection will automatically be considered better.
The caller should create an
NWTCPConnection and watch for the
has property. When this property is
true, the caller should attempt to create a new upgrade connection, with the goal to start transferring data on the new connection path as soon as possible to reduce power and avoid expensive networks. When the new connection is successfully connected the caller can start using the new connection and cancel the original one.