Package io.netty.handler.codec.string

Examples of io.netty.handler.codec.string.StringDecoder


        protected void initChannel(Channel ch) throws Exception {
           
            ChannelPipeline channelPipeline = ch.pipeline();
            clientInvoked = true;
            channelPipeline.addLast("decoder-DELIM", new DelimiterBasedFrameDecoder(maxLineSize, true, Delimiters.lineDelimiter()));
            channelPipeline.addLast("decoder-SD", new StringDecoder(CharsetUtil.UTF_8));
            channelPipeline.addLast("encoder-SD", new StringEncoder(CharsetUtil.UTF_8));
            channelPipeline.addLast("handler", new ClientChannelHandler(producer));
          
        }
View Full Code Here


        JndiRegistry registry = super.createRegistry();

        // START SNIPPET: registry-beans
        ChannelHandlerFactory lengthDecoder = ChannelHandlerFactories.newLengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4);

        StringDecoder stringDecoder = new StringDecoder();
        registry.bind("length-decoder", lengthDecoder);
        registry.bind("string-decoder", stringDecoder);

        LengthFieldPrepender lengthEncoder = new LengthFieldPrepender(4);
        StringEncoder stringEncoder = new StringEncoder();
View Full Code Here

    public static ChannelHandlerFactory newStringDecoder(Charset charset, String protocol) {
        if ("udp".equalsIgnoreCase(protocol)) {
            return new ShareableChannelHandlerFactory(new DatagramPacketStringDecoder(charset));
        } else {
            return new ShareableChannelHandlerFactory(new StringDecoder(charset));
        }
    }
View Full Code Here

        this.outputCharset = outputCharset;
    }

    @Override
    public void configureNewPipeline(ChannelPipeline pipeline) {
        pipeline.addLast(new StringDecoder(outputCharset))
                .addLast(new StringEncoder(inputCharset));
    }
View Full Code Here

  @Override
  public void initChannel(SocketChannel channel) {
    channel.pipeline()
      .addLast("framer", new DelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()))
      .addLast("stringDecoder", new StringDecoder())
      .addLast("handler", new FileServerHandler(pResolver));
  }
View Full Code Here

                 @Override
                 public void initChannel(SocketChannel ch) throws Exception {
                     ch.pipeline().addLast(
                             new StringEncoder(BufType.BYTE, CharsetUtil.UTF_8),
                             new LineBasedFrameDecoder(8192),
                             new StringDecoder(CharsetUtil.UTF_8),
                             new FileHandler());
                 }
             });

            // Start the server.
View Full Code Here

                 @Override
                 public void initChannel(RxtxChannel ch) throws Exception {
                     ch.pipeline().addLast(
                         new LineBasedFrameDecoder(32768),
                         new StringEncoder(BufType.BYTE),
                         new StringDecoder(),
                         new RxtxClientHandler()
                     );
                 }
             });
View Full Code Here

        pipeline.addLast("ssl", new SslHandler(engine));

        // On top of the SSL handler, add the text line codec.
        pipeline.addLast("framer", new DelimiterBasedFrameDecoder(
                8192, Delimiters.lineDelimiter()));
        pipeline.addLast("decoder", new StringDecoder());
        pipeline.addLast("encoder", new StringEncoder(BufType.BYTE));

        // and then business logic.
        pipeline.addLast("handler", new SecureChatServerHandler());
    }
View Full Code Here

        pipeline.addLast("ssl", new SslHandler(engine));

        // On top of the SSL handler, add the text line codec.
        pipeline.addLast("framer", new DelimiterBasedFrameDecoder(
                8192, Delimiters.lineDelimiter()));
        pipeline.addLast("decoder", new StringDecoder());
        pipeline.addLast("encoder", new StringEncoder(BufType.BYTE));

        // and then business logic.
        pipeline.addLast("handler", new SecureChatClientHandler());
    }
View Full Code Here

          pipeline.addLast("ssl", new SslHandler(engine));
        }

        // Decoders
        pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1000));
        pipeline.addLast("stringDecoder", new StringDecoder(CharsetUtil.UTF_8));

        // Encoder
        pipeline.addLast("stringEncoder", new StringEncoder(CharsetUtil.UTF_8));

        // Handlers
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.string.StringDecoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.