ClientBootstrap cb = new ClientBootstrap(newClientSocketChannelFactory(executor));
EchoHandler sh = new EchoHandler();
EchoHandler ch = new EchoHandler();
sb.getPipeline().addLast("framer", new DelimiterBasedFrameDecoder(512, Delimiters.lineDelimiter()));
sb.getPipeline().addLast("decoder", new StringDecoder(CharsetUtil.ISO_8859_1));
sb.getPipeline().addBefore("decoder", "encoder", new StringEncoder(CharsetUtil.ISO_8859_1));
sb.getPipeline().addAfter("decoder", "handler", sh);
cb.getPipeline().addLast("framer", new DelimiterBasedFrameDecoder(512, Delimiters.lineDelimiter()));
cb.getPipeline().addLast("decoder", new StringDecoder(CharsetUtil.ISO_8859_1));
cb.getPipeline().addBefore("decoder", "encoder", new StringEncoder(CharsetUtil.ISO_8859_1));
cb.getPipeline().addAfter("decoder", "handler", ch);
Channel sc = sb.bind(new InetSocketAddress(0));