Class WebSocketServerMessageHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
org.yamcs.http.WebSocketServerMessageHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelOutboundHandler

public class WebSocketServerMessageHandler extends io.netty.channel.ChannelOutboundHandlerAdapter
Encodes WebSocketServerMessageHandler.InternalServerMessage to either BinaryWebSocketFrame or TextWebSocketFrame depending if the protobuf or json has to be sent.

It takes care of the message priorities, dropping messages with low priority if they would exceed the high water mark

  • Constructor Details

    • WebSocketServerMessageHandler

      public WebSocketServerMessageHandler(HttpServer httpServer, boolean protobuf, long highWriteBufferWaterMark)
  • Method Details

    • write

      public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception
      Specified by:
      write in interface io.netty.channel.ChannelOutboundHandler
      Overrides:
      write in class io.netty.channel.ChannelOutboundHandlerAdapter
      Throws:
      Exception