The documentation seems to indicate that the extension should restart on waiting i.e.
`` private func connectionStateChanged(to state: NWConnection.State) { switch state { case .waiting(let error):
os_log(.debug, log: self.log, "DNSProxyProvider Error opening connection -- waiting : (%{public}@)", error.localizedDescription) connection.restart() }
``
I sometimes find I get into a look when this happens
com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
2021-10-27 15:54:18.214239+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
2021-10-27 15:54:18.214696+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider connectionStateChanged to preparing
2021-10-27 15:54:18.215288+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider Error opening connection -- waiting : (The operation couldn\U2019t be completed. (Network.NWError error 1.))
2021-10-27 15:54:18.215806+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider Error opening connection -- waiting : (The operation couldn\U2019t be completed. (Network.NWError error 1.))
2021-10-27 15:54:18.216271+0100 0x1d7ca Debug 0x0 2300 0 com.otg.titahHQ.OTGDNSProxy: [com.titanhq.otg.OTGDNSProxy:provider] DNSProxyProvider Error opening connection -- waiting : (The operation couldn\U2019t be completed. (Network.NWError error 1.))
The network error here isn't very explanatory. My question is what to do here, if I get too many errors, should I cancel the connection or call flow.closeWithReadError, flow.closeWithWriteError