0

I am implementing a very simple websocket server using Netty (v4). I am basing my code on the websocket example source code that comes with Netty. Do I need to do anything extra to handle framing/fragmentation/packet boundaries? Or can I assume that the example code reassembles the data correctly?

The example uses calls like:

String request = ((TextWebSocketFrame) frame).text();

or:

ctx.channel().write(new TextWebSocketFrame(request.toUpperCase()));

So it doesn't seem to be dealing with fragmentation (at that layer at least). Many Thanks.

1 Answers1

0

The frames are handled as complete frames. If you need to aggregate also ContinumWebSocketFrames you can put WebSocketFrameAggregator in the ChannelPipeline.

Norman Maurer
  • 23,104
  • 2
  • 33
  • 31