add debug

This commit is contained in:
anlicheng 2025-08-20 19:23:43 +08:00
parent f410433aac
commit 5d87075108
2 changed files with 10 additions and 2 deletions

View File

@ -127,6 +127,7 @@ actor SDLSuperClient {
} onCancel: {
self.inboundContinuation.finish()
self.writeContinuation.finish()
self.logger.log("[SDLSuperClient] withTaskCancellationHandler cancel")
}
}

View File

@ -66,6 +66,10 @@ actor SDLUDPHole {
self.eventContinuation.yield(.ready)
try await withThrowingTaskGroup(of: Void.self) { group in
group.addTask {
defer {
self.logger.log("[SDLUDPHole] inbound closed", level: .warning)
}
for try await envelope in inbound {
try Task.checkCancellation()
@ -94,6 +98,10 @@ actor SDLUDPHole {
}
group.addTask {
defer {
self.logger.log("[SDLUDPHole] outbound closed", level: .warning)
}
for try await message in self.writeStream {
try Task.checkCancellation()
@ -107,13 +115,12 @@ actor SDLUDPHole {
}
for try await _ in group { }
self.logger.log("[SDLUDPHole] group closed", level: .warning)
}
}
} onCancel: {
self.writeContinuation.finish()
self.eventContinuation.finish()
self.logger.log("[SDLUDPHole] withTaskCancellationHandler cancel")
}
}