add recoverAfterWake

This commit is contained in:
anlicheng 2026-06-22 12:56:35 +08:00
parent 14c53ce348
commit 6be5c230fa
6 changed files with 25 additions and 5 deletions

View File

@ -448,11 +448,11 @@ actor SDLContextActor {
await self.dnsCloudRestartSignal.request() await self.dnsCloudRestartSignal.request()
await self.dnsLocalRestartSignal.request() await self.dnsLocalRestartSignal.request()
await self.superService.stop() await self.superService.recoverAfterWake()
await self.udpHoleService.stop() await self.udpHoleService.recoverAfterWake()
await self.udpHoleV6Service.stop() await self.udpHoleV6Service.recoverAfterWake()
await self.dnsCloudService.stop() await self.dnsCloudService.recoverAfterWake()
await self.dnsLocalService.stop() await self.dnsLocalService.recoverAfterWake()
} }
private func cleanupRoot() async { private func cleanupRoot() async {

View File

@ -61,6 +61,10 @@ actor DNSCloudService {
await client?.stop() await client?.stop()
} }
func recoverAfterWake() async {
await self.stop()
}
func forward(ipPacketData: Data) async { func forward(ipPacketData: Data) async {
await self.currentClient?.forward(ipPacketData: ipPacketData) await self.currentClient?.forward(ipPacketData: ipPacketData)
} }

View File

@ -43,6 +43,10 @@ actor DNSLocalService {
await client?.stop() await client?.stop()
} }
func recoverAfterWake() async {
await self.stop()
}
func query(tracker: DNSLocalClient.DNSTracker, dnsPayload: Data) async { func query(tracker: DNSLocalClient.DNSTracker, dnsPayload: Data) async {
await self.currentClient?.query(tracker: tracker, dnsPayload: dnsPayload) await self.currentClient?.query(tracker: tracker, dnsPayload: dnsPayload)
} }

View File

@ -55,6 +55,10 @@ actor SDLSuperService {
await session?.stop() await session?.stop()
} }
func recoverAfterWake() async {
await self.stop()
}
func send(type: SDLPacketType, data: Data) async { func send(type: SDLPacketType, data: Data) async {
await self.currentSession?.send(type: type, data: data) await self.currentSession?.send(type: type, data: data)
} }

View File

@ -65,6 +65,10 @@ actor SDLUDPHoleService {
await self.proberActor.cancelAll() await self.proberActor.cancelAll()
} }
func recoverAfterWake() async {
await self.stop()
}
func send(type: SDLPacketType, data: Data, remoteAddress: SocketAddress) async { func send(type: SDLPacketType, data: Data, remoteAddress: SocketAddress) async {
await self.currentSession?.send(type: type, data: data, remoteAddress: remoteAddress) await self.currentSession?.send(type: type, data: data, remoteAddress: remoteAddress)
} }

View File

@ -50,6 +50,10 @@ actor SDLUDPHoleV6Service {
await session?.stop() await session?.stop()
} }
func recoverAfterWake() async {
await self.stop()
}
func send(type: SDLPacketType, data: Data, remoteAddress: SocketAddress) async { func send(type: SDLPacketType, data: Data, remoteAddress: SocketAddress) async {
await self.currentSession?.send(type: type, data: data, remoteAddress: remoteAddress) await self.currentSession?.send(type: type, data: data, remoteAddress: remoteAddress)
} }