+---+----+------+----+ | A | BC | DEFG | HI | +---+----+------+----+
+-----+-----+-----+ | ABC | DEF | GHI | +-----+-----+-----+
335336337338339340341342343344345
conf.getNettyCompressionEncoder(), handlerToUseExecutionGroup, executionGroup, ch); } PipelineUtils.addLastWithExecutorCheck( "fixed-length-frame-decoder", new FixedLengthFrameDecoder( RequestServerHandler.RESPONSE_BYTES), handlerToUseExecutionGroup, executionGroup, ch); PipelineUtils.addLastWithExecutorCheck("request-encoder", new RequestEncoder(conf), handlerToUseExecutionGroup, executionGroup, ch);
8384858687888990919293
// Remove SaslClientHandler and replace LengthFieldBasedFrameDecoder // from client pipeline. ctx.pipeline().remove(this); ctx.pipeline().replace("length-field-based-frame-decoder", "fixed-length-frame-decoder", new FixedLengthFrameDecoder(RequestServerHandler.RESPONSE_BYTES)); return; } SaslTokenMessageRequest serverToken = (SaslTokenMessageRequest) decodedMessage; if (LOG.isDebugEnabled()) {
65666768697071727374757677787980818283
final EchoHandler ch = new EchoHandler(autoRead); sb.childHandler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel sch) throws Exception { sch.pipeline().addLast("decoder", new FixedLengthFrameDecoder(1024)); sch.pipeline().addAfter("decoder", "handler", sh); } }); cb.handler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel sch) throws Exception { sch.pipeline().addLast("decoder", new FixedLengthFrameDecoder(1024)); sch.pipeline().addAfter("decoder", "handler", ch); } }); Channel sc = sb.bind().sync().channel();