Riku
2025-06-02 e731486b50c4ea6e2d28f302df449b4bd0b2be57
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))