Post

Replies

Boosts

Views

Activity

Comment on Different behaviour of NWUDPSession's setReadHandler on different iOS version when remote server is unavailable
On iOS 14 if the server application was stopped the client just acts as it doesn't detect anything from the server-side, it's understandable since the UDP session is stateless. On iOS 12 if the server application was stopped the client-side can give out an error message on the UDP session read handler which I think is great. I don't know how it works but it seems this mechanism is not provided on iOS 14.
Aug ’21
Comment on Different behaviour of NWUDPSession's setReadHandler on different iOS version when remote server is unavailable
Thanks Matt. As I observed on iOS 14.7.1 when the VPN tunnel (which is a UDP session) is established if I stop the VPN server, the isViable is still true, and state is still ready, and the packetFlow keeps reading packets and also can writeMultipleDatagrams without any problems. And this status can last for a long time, I never see it stop. It seems the UDP session's read handler is just not called. But once if I restart the VPN server's service, then it will give out errors like Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" Error Domain=NSPOSIXErrorDomain Code=89 "Operation canceled"
Jul ’21