I am trying to migrate an app to use Network framework for p2p connection. I came across this great article for migrating to Network framework however this doesnt use the new structured concurrency. This being introduced with iOS 26, there doesnt seem to be any sample code available on how to use the new classes. I am particularly interested in code samples showing how to add TLS with PSK encryption support and handling of switching between Wifi and peer to peer interface with the new structured concurrency supported classes. Are there any good resources I can refer on this other than the WWDC video?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Are the Wifi-Aware's WAEndpoint's discovered ephemeral? I'm trying to understand what's the best way to reconnect a disconnected WifiAware connection - Can I just cache the endpoint and start a new connection with the same endpoint or do I need to browse again and get a new WAEndpoint?
My use case requires both WifiAware connection to another device and the devices also need to be connected to infrastructure wifi most of the time. I'm concerned about the WifiAware's connection having any impact on infrastructure wifi. What is the impact on the infrastructure wifi here in comparison to using the Apple peer to peer wifi(That Multipeer framework or Network framework use)?
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 be other?
It would be great if there is a workflow or example of how this needs to be handled with multiple available Interfaces.
I have some confusion around the usage of DeviceDiscoveryUI. The documentation suggests that it is available only on TVOS. But with the recent announcement of WifiAware, it has been used in iOS devices as well. Within DeviceDiscoveryUI, the DevicePicker or the DevicePairingView documentation seems to be available with iOS. Is this just a documentation mistake?
Followup - Can I use DeviceDiscoveryUI's DevicePicker/ DevicePairingView to discover devices through Bonjour and then establish a connection through Network framework?
I am planning to implement Peer to Peer data exchange between 2 iOS devices. I have the following queries.
My devices are connected through Ethernet. I would prefer to use this route if possible before switching over to Wifi. I can see there is an option to use prohibitedInterfaceTypes but that doesn't guarantee the route to use Ethernet when there are multiple available.
Does the connection automatically switch between ethernet and Wifi or does that have to be handled via isViable and betterPathAvailable?
I'm unsure when I should be using a custom framing protocol. I just need to exchange codable objects between the devices. Is the custom protocol required only if I use TCP as the underlying protocol?
Can NSURLSessionStreamTask be used for this use case?
I have a use case where I have two iOS devices that needs to exchange JSON objects between each other. It is a bidirectional flow of data and the request can trigger from each device at any point of time. I would like to understand if I can achieve this using CoreBluetooth? I have checked multipeer connectivity and although that does do the Job for me, it seems an overkill since I don't have multiple peers. I have a set of devices that will always be talking to one other device i.e, 1:1 mapping of all the devices that I have and there is no cross connection.
Topic:
App & System Services
SubTopic:
Networking
Tags:
Multipeer Connectivity
Network
Core Bluetooth