Package org.jboss.netty.handler.codec.frame

Examples of org.jboss.netty.handler.codec.frame.LengthFieldPrepender


    }

    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = pipeline();
        pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(maxFrameSize, 0, 4, 0, 4));
        pipeline.addLast("frameEncoder", new LengthFieldPrepender(4));
        pipeline.addLast("thriftHandler", (ChannelHandler)handler);
        return pipeline;
    }
View Full Code Here


        if (client.getSslFactory() != null) {
            pipeline.addLast("ssl", new SslHandler(client.getSslFactory().getEngine()));
        }
        pipeline.addLast("lengthbaseddecoder", new LengthFieldBasedFrameDecoder(client.getConfiguration()
                         .getMaximumMessageSize(), 0, 4, 0, 4));
        pipeline.addLast("lengthprepender", new LengthFieldPrepender(4));

        pipeline.addLast("protobufdecoder", new ProtobufDecoder(PubSubProtocol.PubSubResponse.getDefaultInstance()));
        pipeline.addLast("protobufencoder", new ProtobufEncoder());

        pipeline.addLast("responsehandler", new ResponseHandler(client));
View Full Code Here

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

        LengthFieldPrepender lengthEncoder = new LengthFieldPrepender(4);
        StringEncoder stringEncoder = new StringEncoder();
        registry.bind("length-encoder", lengthEncoder);
        registry.bind("string-encoder", stringEncoder);

        List<ChannelHandler> decoders = new ArrayList<ChannelHandler>();
View Full Code Here

        bootstrap = new ClientBootstrap(factory);
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline() {
                ChannelPipeline p = Channels.pipeline();
                p.addLast("1", new LengthFieldPrepender(4));
                p.addLast("2", new ExceptionHandler());
                return p;
            }
        });
View Full Code Here

  public ChannelPipeline getPipeline() throws Exception {
    ChannelPipeline p = Channels.pipeline();
    p.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1048576*2, 0, 4,
        0, 4));
    p.addLast("protobufDecoder", new ProtobufDecoder(defaultInstance));
    p.addLast("frameEncoder", new LengthFieldPrepender(4));
    p.addLast("protobufEncoder", new ProtobufEncoder());
    p.addLast("handler", handler);
    return p;
  }
View Full Code Here

    amf3Protocol.setEventDecoder(new EventDecoder());
    amf3Protocol.setAmf3ToEventSourceDecoder(new AMF3ToEventSourceDecoder());
    amf3Protocol.setEventSourceToAMF3Encoder(new EventSourceToAMF3Encoder());
    amf3Protocol.setEventEncoder(new EventEncoder());
    amf3Protocol
        .setLengthFieldPrepender(new LengthFieldPrepender(2, false));
    playerStats = new PlayerStats(10, 11.1f, 12.2f, 10);
  }
View Full Code Here

 
  @Before
  public void setUp()
  {
    messageBufferProtocol = new MessageBufferProtocol();
    messageBufferProtocol.setLengthFieldPrepender(new LengthFieldPrepender(2, false));
    messageBufferProtocol.setMessageBufferEventDecoder(new MessageBufferEventDecoder());
    messageBufferProtocol.setMessageBufferEventEncoder(new MessageBufferEventEncoder());
    frameDecoder = messageBufferProtocol.createLengthBasedFrameDecoder();
  }
View Full Code Here

        LengthFieldBasedFrameDecoder lengthDecoder = new LengthFieldBasedFrameDecoder(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();
        registry.bind("length-encoder", lengthEncoder);
        registry.bind("string-encoder", stringEncoder);

        List<ChannelUpstreamHandler> decoders = new ArrayList<ChannelUpstreamHandler>();
View Full Code Here

        LengthFieldBasedFrameDecoder lengthDecoder = new LengthFieldBasedFrameDecoder(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();
        registry.bind("length-encoder", lengthEncoder);
        registry.bind("string-encoder", stringEncoder);

        List<ChannelUpstreamHandler> decoders = new ArrayList<ChannelUpstreamHandler>();
View Full Code Here

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

        LengthFieldPrepender lengthEncoder = new LengthFieldPrepender(4);
        StringEncoder stringEncoder = new StringEncoder();
        registry.bind("length-encoder", lengthEncoder);
        registry.bind("string-encoder", stringEncoder);

        List<ChannelHandler> decoders = new ArrayList<ChannelHandler>();
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.frame.LengthFieldPrepender

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.