I would like to understand the behaviour of Network framework when I have established a connection between 2 iOS devices which are connected through LAN and the same Wifi. Assumptions:
- Enabled
includePeerToPeer
. - Devices are discovered and connected through Bonjour:
- When the connection establishes for the first time, does it automatically decide which interface to pick? I see some posts which point to Happy Eyeball algorithm but that seem to point more towards ipv4 vs ipv6 rather than Wifi vs LAN vs P2P.
- In the middle of a connection, if the established connection has issues, does the Network framework automatically switch to the best available interface?
- If not, I would assume the app will have to handle the switching in
betterPathUpdateHandler
callback? I’m curious what needs to be done here. Do I just create a new connection and hope that it picks the actual better path? - The
NWInterface.InterfaceType
doesnt have a type for peer to peer wifi. Does that mean that when the interface actually switches to peer to peer, the InterfaceType will beother?
It would be great if there is a workflow or example of how this needs to be handled with multiple available Interfaces.