fix open method

This commit is contained in:
anlicheng 2025-07-16 17:47:54 +08:00
parent 5c10c7a33b
commit 035ec9343d

View File

@ -79,7 +79,7 @@ public class SDLContext: @unchecked Sendable {
private var flowTracer = SDLFlowTracerActor()
private var flowTracerCancel: AnyCancellable?
init(provider: NEPacketTunnelProvider, config: SDLConfiguration, rsaCipher: RSACipher, aesCipher: AESCipher) throws {
public init(provider: NEPacketTunnelProvider, config: SDLConfiguration, rsaCipher: RSACipher, aesCipher: AESCipher) throws {
self.config = config
self.rsaCipher = rsaCipher
self.aesCipher = aesCipher
@ -96,7 +96,7 @@ public class SDLContext: @unchecked Sendable {
self.noticeClient = SDLNoticeClient()
}
func start() async throws {
public func start() async throws {
try await self.startSuperClient()
try await self.startUDPHole()
self.noticeClient.start()
@ -350,7 +350,7 @@ public class SDLContext: @unchecked Sendable {
}
//
func flowReportTask() {
public func flowReportTask() {
Task {
//
self.flowTracerCancel = Timer.publish(every: 60.0, on: .main, in: .common).autoconnect()
@ -506,7 +506,7 @@ public class SDLContext: @unchecked Sendable {
extension SDLContext {
static func getUUID() -> String {
public static func getUUID() -> String {
let userDefaults = UserDefaults.standard
if let uuid = userDefaults.value(forKey: "gClientId") as? String {
return uuid
@ -519,7 +519,7 @@ extension SDLContext {
}
// mac
static func getMacAddress() -> Data {
public static func getMacAddress() -> Data {
let key = "gMacAddress2"
let userDefaults = UserDefaults.standard