}
}
+ @available(*, renamed: "modify(tunnel:tunnelConfiguration:onDemandOption:shouldEnsureOnDemandEnabled:)")
func modify(tunnel: TunnelContainer, tunnelConfiguration: TunnelConfiguration,
onDemandOption: ActivateOnDemandOption,
shouldEnsureOnDemandEnabled: Bool = false,
}
}
+ @available(iOS 13.0, macOS 10.15.0, *)
+ func modify(tunnel: TunnelContainer, tunnelConfiguration: TunnelConfiguration,
+ onDemandOption: ActivateOnDemandOption,
+ shouldEnsureOnDemandEnabled: Bool = false) async throws {
+ return try await withCheckedThrowingContinuation { continuation in
+ modify(tunnel: tunnel, tunnelConfiguration: tunnelConfiguration, onDemandOption: onDemandOption, shouldEnsureOnDemandEnabled: shouldEnsureOnDemandEnabled) { error in
+ if let error = error {
+ continuation.resume(throwing: error)
+ return
+ }
+
+ continuation.resume(returning: ())
+ }
+ }
+ }
+
func remove(tunnel: TunnelContainer, completionHandler: @escaping (TunnelsManagerError?) -> Void) {
let tunnelProviderManager = tunnel.tunnelProvider
#if os(macOS)