Greetings @byron_coderus, @eskimo,
Hopping on the back of @byron_coderus question:
Is it possible to prevent an iOS device with Wi-Fi and Cellular interfaces from disassociating itself from Wi-Fi - and keeping it in a state where it is always ready to process incoming network traffic? Ideally without resorting to preventing system sleep by playing audio in the background, or keeping the screen awake or the device plugged in to power.
We are using the PacketTunnelProvider
, with logic in the network extension listening on a specific UDP port. The use case is relaying traffic from a device on the Wi-Fi network, to a remote server using its cellular connection.
From our investigation so far, we've noticed that if the device screen is off, the sleep()
method may be invoked, with the device entering system sleep shortly after. In this state, the device does not respond to ICMP pings, but may still be able to receive other network traffic, which wakes the device for a short amount of time as it handles the traffic.
After some time, a sleeping device will disassociate itself from the Wi-Fi, causing any packets to be sent to the device to be dropped. Is there any way to prevent this? We have tried sending arbitrary packets to the device every second in order to keep it awake, but it often still sleeps for periods of 2-4 seconds.
Regards,
Chris