Instance Method

urlSession(_:betterRouteDiscoveredFor:)

Tells the delegate that a better route to the host has been detected for the stream.

Declaration

optional func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask)

Parameters

session

The session of the stream task that discovered a better route.

streamTask

The stream task that discovered a better route.

Discussion

This method is called when the URL loading system determines that a better route to the endpoint host is available. For example, this method may be called when a Wi-Fi interface becomes available.

You should consider completing pending work and creating a new stream task in order to take advantage of better routes when they become available.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software