Skip to content

Commit 95bf6b5

Browse files
committed
avoid double connecting
1 parent c0a46aa commit 95bf6b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Coder Desktop/Coder Desktop/XPCInterface.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ import VPNLib
66
@objc final class VPNXPCInterface: NSObject, VPNXPCClientCallbackProtocol, @unchecked Sendable {
77
private var svc: CoderVPNService
88
private let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "VPNXPCInterface")
9-
private var xpc: VPNXPCProtocol? = nil
9+
private var xpc: VPNXPCProtocol?
1010

1111
init(vpn: CoderVPNService) {
1212
svc = vpn
1313
super.init()
1414
}
1515

1616
func connect() {
17+
guard xpc == nil else {
18+
return
19+
}
1720
let networkExtDict = Bundle.main.object(forInfoDictionaryKey: "NetworkExtension") as? [String: Any]
1821
let machServiceName = networkExtDict?["NEMachServiceName"] as? String
1922
let xpcConn = NSXPCConnection(machServiceName: machServiceName!)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy