fix
This commit is contained in:
parent
478969d99d
commit
d964eb6e27
@ -139,8 +139,7 @@ actor SDLContextActor {
|
||||
group.addTask {
|
||||
while true {
|
||||
try Task.checkCancellation()
|
||||
try await Task.sleep(nanoseconds: 5 * 1_000_000_000)
|
||||
try Task.checkCancellation()
|
||||
try await Task.sleep(for: .seconds(5))
|
||||
await self.sendStunRequest()
|
||||
}
|
||||
}
|
||||
@ -236,6 +235,8 @@ actor SDLContextActor {
|
||||
stunRequest.mac = self.config.networkAddress.mac
|
||||
stunRequest.natType = UInt32(self.natType.rawValue)
|
||||
|
||||
self.logger.log("[SDLContext] will send stun request")
|
||||
|
||||
if let stunData = try? stunRequest.serializedData() {
|
||||
let remoteAddress = self.config.stunSocketAddress
|
||||
self.udpHole?.send(type: .stunRequest, data: stunData, remoteAddress: remoteAddress)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user