fix udpHole
This commit is contained in:
parent
55701085e3
commit
dcbaffe70e
@ -172,7 +172,8 @@ actor SDLContextActor {
|
||||
quicClient.start()
|
||||
|
||||
defer {
|
||||
quicClient.stop()
|
||||
self.quicClient?.stop()
|
||||
self.quicClient = nil
|
||||
SDLLogger.log("[SDLContext] quicClient: stop")
|
||||
}
|
||||
|
||||
|
||||
@ -67,15 +67,14 @@ final class SDLUDPHole: ChannelInboundHandler {
|
||||
}
|
||||
|
||||
// --MARK: ChannelInboundHandler delegate
|
||||
|
||||
|
||||
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
|
||||
let envelope = unwrapInboundIn(data)
|
||||
var buffer = envelope.data
|
||||
let remoteAddress = envelope.remoteAddress
|
||||
|
||||
if let rawBytes = buffer.getBytes(at: buffer.readerIndex, length: buffer.readableBytes) {
|
||||
SDLLogger.log("[SDLUDPHole] get raw bytes: \(rawBytes.count), from: \(remoteAddress)", for: .debug)
|
||||
}
|
||||
let byteCount = buffer.readableBytes - buffer.readerIndex
|
||||
SDLLogger.log("[SDLUDPHole] get raw bytes: \(byteCount), from: \(remoteAddress)", for: .debug)
|
||||
|
||||
do {
|
||||
if let message = try SDLHoleMessage.decode(buffer: &buffer) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user