FrameDecoder use one ChannelBuffer instance(field cumulation) to sum up all Channel’s raw data, then pass to decode. There are chances when part of Channel A’s data of whole frame(app level frame) write to cumulation, then part of Channel B’s data of whole frame write to cumulation. As I understand cumulation should use ChannelLocal to store different instance for different Channel to avoid this situation. Does the situation do exists or I understood the code wrong?
FrameDecoder use one ChannelBuffer instance(field cumulation) to sum up all Channel’s raw data, then
Share
You should use a new instance of the class that extends FrameDecoder for every new connection (channel). This is true for all ChannelHandlers that are not marked with the @Sharable [1] annotation.
[1] http://netty.io/docs/stable/api/org/jboss/netty/channel/ChannelHandler.Sharable.html