fix context

This commit is contained in:
anlicheng 2026-05-27 22:57:39 +08:00
parent 78ec74a0cb
commit 83bd5dce7e
2 changed files with 20 additions and 11 deletions

View File

@ -13,17 +13,6 @@ import NIOCore
/* /*
1. rsa的加解密逻辑 1. rsa的加解密逻辑
*/ */
enum SDLContextError: Error {
case udpHoleClosed
case dnsLocalClientClosed
case dnsLocalClientCancelled
case dnsClientClosed
case dnsClientCancelled
}
actor SDLContextActor { actor SDLContextActor {
private var config: SDLConfiguration private var config: SDLConfiguration
@ -129,6 +118,7 @@ actor SDLContextActor {
// //
self.policyService = policyService self.policyService = policyService
self.dnsCloudService = dnsCloudService self.dnsCloudService = dnsCloudService
self.dnsLocalService = dnsLocalService self.dnsLocalService = dnsLocalService
self.superService = superService self.superService = superService
@ -193,6 +183,7 @@ actor SDLContextActor {
await self.dnsCloudService.updateEventHandler { [weak self] event in await self.dnsCloudService.updateEventHandler { [weak self] event in
await self?.handleDNSEvent(event) await self?.handleDNSEvent(event)
} }
await self.dnsLocalService.updateEventHandler { [weak self] event in await self.dnsLocalService.updateEventHandler { [weak self] event in
await self?.handleDNSEvent(event) await self?.handleDNSEvent(event)
} }
@ -210,6 +201,7 @@ actor SDLContextActor {
await packetInboundActor.handleData(data) await packetInboundActor.handleData(data)
} }
) )
await self.udpHoleV6Service.updateHandlers( await self.udpHoleV6Service.updateHandlers(
onEvent: { [weak self] event in onEvent: { [weak self] event in
await self?.handleUDPHoleControlEvent(event) await self?.handleUDPHoleControlEvent(event)

View File

@ -0,0 +1,17 @@
//
// SDLContextError.swift
// punchnet
//
// Created by on 2026/5/27.
//
import Foundation
enum SDLContextError: Error {
case udpHoleClosed
case dnsLocalClientClosed
case dnsLocalClientCancelled
case dnsClientClosed
case dnsClientCancelled
}