https://developer.apple.com/documentation/NetworkExtension/filtering-network-traffic
App example not auto reconnect after network extension crush.
what need to add for auto reconnect when network extension restart?
In the Filtering Network Traffic, the content filter is a system extension. This is roughly equivalent to a launchd daemon, so you manage your XPC connection in the same way you would for a launchd daemon. That is:
- When setting up the connection, install both invalidation and interruption handlers.
- If the invalidation handler is called, the named XPC endpoint has gone away completely, and so attempting to reconnect won’t help.
- If the interruption handler is called, this specific XPC connection is toast but the named XPC endpoint is still around and so you should attempt to re-establish that connection.
The sample doesn’t do this, but such is the nature of sample code — it tends to cut corners so that it can focus on what’s critical. In this case, this is an NE content filter sample, not an XPC sample, and thus its XPC code is simpler than you’d need in a real product.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"