This commit is contained in:
anlicheng 2025-08-01 23:57:01 +08:00
parent 5b57087ea2
commit 7af3b235e7
2 changed files with 10 additions and 3 deletions

View File

@ -31,8 +31,15 @@ struct ARPPacket {
var targetMAC: Data
var targetIP: UInt32
init(hardwareType: UInt16, protocolType: UInt16, hardwareSize: UInt8, protocolSize: UInt8, opcode: Opcode,
senderMAC: Data, senderIP: UInt32, targetMAC: Data, targetIP: UInt32) {
init(hardwareType: UInt16,
protocolType: UInt16,
hardwareSize: UInt8,
protocolSize: UInt8,
opcode: Opcode,
senderMAC: Data,
senderIP: UInt32,
targetMAC: Data,
targetIP: UInt32) {
self.hardwareType = hardwareType
self.protocolType = protocolType

View File

@ -544,7 +544,7 @@ public class SDLContext: @unchecked Sendable {
publisher.send(request)
} else {
let publisher = PassthroughSubject<RegisterRequest, Never>()
publisher.debounce(for: .seconds(5), scheduler: DispatchQueue.global())
publisher.throttle(for: .seconds(5), scheduler: DispatchQueue.global(), latest: true)
.sink { request in
Task {
await self.tryHole(request: request)