Compare commits

..

3 Commits

Author SHA1 Message Date
2c05d71dbe add macos 2025-08-03 23:26:30 +08:00
325a1674d3 remove platform 2025-08-03 23:01:21 +08:00
de16c1ad18 fix logger 2025-08-03 13:15:59 +08:00
6 changed files with 7 additions and 8 deletions

View File

@ -7,7 +7,7 @@ let package = Package(
name: "sdlan", name: "sdlan",
platforms: [ platforms: [
.iOS(.v17), .iOS(.v17),
.macOS(.v10_13) .macOS(.v14)
], ],
products: [ products: [
// Products define the executables and libraries a package produces, making them visible to other packages. // Products define the executables and libraries a package produces, making them visible to other packages.

View File

@ -15,6 +15,7 @@ import Combine
1. rsa的加解密逻辑 1. rsa的加解密逻辑
*/ */
@available(macOS 14, *)
public class SDLContext: @unchecked Sendable { public class SDLContext: @unchecked Sendable {
// //
@ -214,7 +215,7 @@ public class SDLContext: @unchecked Sendable {
case .changed: case .changed:
// nat // nat
Task { Task {
self.natType = await SDLNatProber.getNatType(udpHole: self.udpHole, config: self.config) self.natType = await SDLNatProber.getNatType(udpHole: self.udpHole, config: self.config, logger: self.logger)
self.logger.log("didNetworkPathChanged, nat type is: \(self.natType)", level: .info) self.logger.log("didNetworkPathChanged, nat type is: \(self.natType)", level: .info)
} }
case .unreachable: case .unreachable:
@ -583,12 +584,6 @@ public class SDLContext: @unchecked Sendable {
self.superClient = nil self.superClient = nil
} }
}
//--MARK: UUID
extension SDLContext {
public static func getUUID() -> String { public static func getUUID() -> String {
let userDefaults = UserDefaults.standard let userDefaults = UserDefaults.standard
if let uuid = userDefaults.value(forKey: "gClientId") as? String { if let uuid = userDefaults.value(forKey: "gClientId") as? String {

View File

@ -9,6 +9,7 @@ import Foundation
import NIOCore import NIOCore
// //
@available(macOS 14, *)
struct SDLNatProber { struct SDLNatProber {
// nat // nat

View File

@ -19,6 +19,7 @@ import NIOCore
import NIOPosix import NIOPosix
// sn-server // sn-server
@available(macOS 14, *)
actor SDLNoticeClient { actor SDLNoticeClient {
private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
private let asyncChannel: NIOAsyncChannel<AddressedEnvelope<ByteBuffer>, AddressedEnvelope<ByteBuffer>> private let asyncChannel: NIOAsyncChannel<AddressedEnvelope<ByteBuffer>, AddressedEnvelope<ByteBuffer>>

View File

@ -10,6 +10,7 @@ import NIOCore
import NIOPosix import NIOPosix
// --MARK: SuperNode // --MARK: SuperNode
@available(macOS 14, *)
actor SDLSuperClient { actor SDLSuperClient {
private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
private let asyncChannel: NIOAsyncChannel<ByteBuffer,ByteBuffer> private let asyncChannel: NIOAsyncChannel<ByteBuffer,ByteBuffer>

View File

@ -10,6 +10,7 @@ import NIOCore
import NIOPosix import NIOPosix
// sn-server // sn-server
@available(macOS 14, *)
actor SDLUDPHole { actor SDLUDPHole {
private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
private let asyncChannel: NIOAsyncChannel<AddressedEnvelope<ByteBuffer>, AddressedEnvelope<ByteBuffer>> private let asyncChannel: NIOAsyncChannel<AddressedEnvelope<ByteBuffer>, AddressedEnvelope<ByteBuffer>>