Note that there are some explanatory texts on larger screens.

plurals
  1. POConvert from Netty 4.0 CR3 to 4.0.10-final
    text
    copied!<p>I am upgrading my frameworks Netty version to the newest and it seems that the API has broke (I know I shouldn't have used it until a final version was out); I have been reading over the docs and looking through classes to try and find a feasible solution but I cannot find one. </p> <pre><code> ctx.nextInboundMessageBuffer().add(message); ctx.fireInboundBufferUpdated(); if (additionalBuf != null) { ChannelHandlerContext head = ctx.pipeline().firstContext(); head.nextInboundByteBuffer().writeBytes(additionalBuf); head.fireInboundBufferUpdated(); } </code></pre> <p>Is what I am trying to convert to the new API, any help is appreciated. </p> <p>Full code:</p> <pre><code>@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List&lt;Object&gt; out) throws Exception { if (!in.isReadable()) { return; } int messageId = in.readUnsignedByte(); ByteBuf additionalBuf = null; if (in.isReadable()) { additionalBuf = in.readBytes(in.readableBytes()); } ChannelPipeline pipeline = ctx.pipeline(); pipeline.remove(HandshakeDecoder.class); HandshakeMessage message = HandshakeMessage.forId(messageId); switch (message) { case LOGIN_MESSAGE: break; case UPDATE_MESSAGE: break; default: throw new IllegalStateException("Unexpected message id: " + messageId); } ctx.nextInboundMessageBuffer().add(message); ctx.fireInboundBufferUpdated(); if (additionalBuf != null) { ChannelHandlerContext head = ctx.pipeline().firstContext(); head.nextInboundByteBuffer().writeBytes(additionalBuf); head.fireInboundBufferUpdated(); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload