This commit is contained in:
anlicheng 2025-08-02 23:56:40 +08:00
parent 3e96169690
commit a292bec2c4
2 changed files with 4 additions and 3 deletions

View File

@ -120,7 +120,7 @@ public class SDLContext: @unchecked Sendable {
do {
try await self.startSuperClient()
} catch let err {
NSLog("SuperClient get error: \(err)")
NSLog("[SDLContext] SuperClient get error: \(err), will restart")
await self.arpServer.clear()
try? await Task.sleep(for: .seconds(2))
}

View File

@ -9,8 +9,6 @@ import Foundation
import NIOCore
import NIOPosix
// --MARK: SuperNode
actor SDLSuperClient {
private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
@ -82,6 +80,7 @@ actor SDLSuperClient {
}
}
}
NSLog("[SDLSuperClient] inbound closed")
}
group.addTask {
@ -92,6 +91,7 @@ actor SDLSuperClient {
buffer.writeBytes(message.data)
try await outbound.write(buffer)
}
NSLog("[SDLSuperClient] outbound closed")
}
// --MARK:
@ -100,6 +100,7 @@ actor SDLSuperClient {
await self.ping()
try? await Task.sleep(nanoseconds: 5 * 1_000_000_000)
}
NSLog("[SDLSuperClient] heartbeat cancelled")
}
try await group.waitForAll()