diff --git a/Tun/Punchnet/Actors/SDLContextActor.swift b/Tun/Punchnet/Actors/SDLContextActor.swift index 9b8ef02..d24d249 100644 --- a/Tun/Punchnet/Actors/SDLContextActor.swift +++ b/Tun/Punchnet/Actors/SDLContextActor.swift @@ -265,6 +265,7 @@ actor SDLContextActor { defer { quicClient.stop() + SDLLogger.log("[SDLContext] quicClient: stop") } // 这里必须等待quic的协商完成 @@ -509,7 +510,7 @@ actor SDLContextActor { self.udpHoleV6 = nil self.udpHoleV6LocalAddress = nil - await self.quicClient?.stop() + self.quicClient?.stop() self.quicClient = nil await self.dnsClient?.stop() @@ -630,7 +631,7 @@ actor SDLContextActor { // 开启新的任务 self.readTask = Task.detached(priority: .high) { - while true { + repeat { if Task.isCancelled { return } @@ -641,7 +642,7 @@ actor SDLContextActor { await self.dealTunPacket(packet: ipPacket) } } - } + } while true } }