TunnelsManager: Ability to refresh connection statuses
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
3136fe0e2c
commit
59b9a6e5d2
|
@ -208,6 +208,12 @@ class TunnelsManager {
|
|||
}
|
||||
tunnel.startDeactivation()
|
||||
}
|
||||
|
||||
func refreshConnectionStatuses() {
|
||||
for t in tunnels {
|
||||
t.refreshConnectionStatus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TunnelContainer: NSObject {
|
||||
|
@ -232,6 +238,14 @@ class TunnelContainer: NSObject {
|
|||
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) {
|
||||
assert(status == .inactive || status == .restarting)
|
||||
|
||||
|
|
Loading…
Reference in New Issue