feiyu02
2025-08-14 b10c22af595bd995e56946bff63b8f2f984b13e8
src/main/kotlin/com/flightfeather/uav/socket/sender/UnderwayWebSocketSender.kt
@@ -1,5 +1,6 @@
package com.flightfeather.uav.socket.sender
import com.flightfeather.uav.socket.decoder.UnderwayWebSocketParser
import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame
@@ -28,6 +29,11 @@
    }
    fun broadcast(type:Int, content:Any) {
        val msg = UnderwayWebSocketParser.encodeMessage(WebSocketMessage(type,content))
        broadcast(msg)
    }
    fun broadcast(msg: String) {
        sessionPool.forEach { (t, u) ->
            u?.channel()?.writeAndFlush(TextWebSocketFrame(msg))