TunnelsManager: Ability to refresh connection statuses
This commit is contained in:
parent
c9c58f3755
commit
fefa39de46
|
@ -208,6 +208,12 @@ class TunnelsManager {
|
||||||
}
|
}
|
||||||
tunnel.startDeactivation()
|
tunnel.startDeactivation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func refreshConnectionStatuses() {
|
||||||
|
for t in tunnels {
|
||||||
|
t.refreshConnectionStatus()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TunnelContainer: NSObject {
|
class TunnelContainer: NSObject {
|
||||||
|
@ -232,6 +238,14 @@ class TunnelContainer: NSObject {
|
||||||
return (tunnelProvider.protocolConfiguration as! NETunnelProviderProtocol).tunnelConfiguration()
|
return (tunnelProvider.protocolConfiguration as! NETunnelProviderProtocol).tunnelConfiguration()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func refreshConnectionStatus() {
|
||||||
|
let status = TunnelStatus(from: self.tunnelProvider.connection.status)
|
||||||
|
self.status = status
|
||||||
|
if (status != .inactive) {
|
||||||
|
startObservingTunnelStatus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fileprivate func startActivation(completionHandler: @escaping (Error?) -> Void) {
|
fileprivate func startActivation(completionHandler: @escaping (Error?) -> Void) {
|
||||||
assert(status == .inactive || status == .restarting)
|
assert(status == .inactive || status == .restarting)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue