From 5f36c2804094550a543ac2d9566af095192f8bab Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 20 May 2026 23:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Concurrency/SDLAsyncTimerStream.swift | 33 ------------------- .../Inbound/PacketInboundProcessor.swift | 1 + 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 Tun/Punchnet/Concurrency/SDLAsyncTimerStream.swift diff --git a/Tun/Punchnet/Concurrency/SDLAsyncTimerStream.swift b/Tun/Punchnet/Concurrency/SDLAsyncTimerStream.swift deleted file mode 100644 index 03f9fbe..0000000 --- a/Tun/Punchnet/Concurrency/SDLAsyncTimerStream.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// SDLAsyncTimerStream.swift -// Tun -// -// Created by 安礼成 on 2026/2/3. -// - -import Foundation - -class SDLAsyncTimerStream { - let timer: DispatchSourceTimer - let stream: AsyncStream - private let cont: AsyncStream.Continuation - - init() { - self.timer = DispatchSource.makeTimerSource(queue: .global()) - (stream, cont) = AsyncStream.makeStream(of: Void.self) - } - - func start(interval: DispatchTimeInterval) { - timer.schedule(deadline: .now(), repeating: interval) - timer.setEventHandler { [weak self] in - self?.cont.yield() - } - timer.resume() - } - - deinit { - self.cont.finish() - self.timer.cancel() - } - -} diff --git a/Tun/Punchnet/Inbound/PacketInboundProcessor.swift b/Tun/Punchnet/Inbound/PacketInboundProcessor.swift index 9ba880b..30d5065 100644 --- a/Tun/Punchnet/Inbound/PacketInboundProcessor.swift +++ b/Tun/Punchnet/Inbound/PacketInboundProcessor.swift @@ -8,6 +8,7 @@ import Foundation final class PacketInboundProcessor { + enum ProcessingAction { case sendARPReply(dstMac: Data, data: Data) case appendARP(ip: UInt32, mac: Data)