fix
This commit is contained in:
parent
739acd3938
commit
23d15e3d17
@ -17,14 +17,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
|||||||
private var rootTask: Task<Void, Error>?
|
private var rootTask: Task<Void, Error>?
|
||||||
|
|
||||||
override func startTunnel(options: [String: NSObject]?, completionHandler: @escaping (Error?) -> Void) {
|
override func startTunnel(options: [String: NSObject]?, completionHandler: @escaping (Error?) -> Void) {
|
||||||
|
|
||||||
let shared = UserDefaults(suiteName: "group.com.jihe.punchnetmac")
|
|
||||||
let msg = shared?.string(forKey: "test_msg")
|
|
||||||
SDLLogger.log("NE read message: \(msg ?? "failed")", for: .debug)
|
|
||||||
SDLTunnelAppNotifier.shared.clear()
|
SDLTunnelAppNotifier.shared.clear()
|
||||||
|
|
||||||
SDLNotificationCenter.shared.post(.vpnStatusChanged)
|
|
||||||
|
|
||||||
// 如果当前在运行状态,不允许重复请求
|
// 如果当前在运行状态,不允许重复请求
|
||||||
guard self.contextActor == nil else {
|
guard self.contextActor == nil else {
|
||||||
completionHandler(TunnelError.invalidContext)
|
completionHandler(TunnelError.invalidContext)
|
||||||
|
|||||||
@ -17,7 +17,6 @@ public struct DarwinNotificationName: RawRepresentable, Hashable {
|
|||||||
|
|
||||||
// 预定义名称
|
// 预定义名称
|
||||||
extension DarwinNotificationName {
|
extension DarwinNotificationName {
|
||||||
static let vpnStatusChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.vpnStatusChanged")
|
|
||||||
static let tunnelEventChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.tunnelEventChanged")
|
static let tunnelEventChanged = DarwinNotificationName(rawValue: "com.jihe.punchnetmac.tunnelEventChanged")
|
||||||
}
|
}
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user