Examples of LengthFieldBasedFrameDecoder


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

    return pipeline;
  }
 
  public ChannelHandler createLengthBasedFrameDecoder()
  {
    return new LengthFieldBasedFrameDecoder(frameSize, 0, 2, 0, 2);
  }
View Full Code Here

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

     * prepending the length to outgoing packets etc.
     */
    @Override
    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = Channels.pipeline();
        pipeline.addLast("lengthbasedframedecoder", new LengthFieldBasedFrameDecoder(MAX_FRAME_LENGTH, 0, 4, 0, 4));
        pipeline.addLast("mainhandler", this);
        return pipeline;
    }
View Full Code Here

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

        // Channels helper class.
        ChannelPipeline pipeline = Channels.pipeline();
        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());
View Full Code Here

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

                                                                        final int lengthFieldLength, final int lengthAdjustment,
                                                                        final int initialBytesToStrip) {
        return new ChannelHandlerFactory() {
            @Override
            public ChannelHandler newChannelHandler() {
                return new LengthFieldBasedFrameDecoder(maxFrameLength, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip);
            }
        };
    }
View Full Code Here

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

        bootstrap = new ServerBootstrap(factory);

        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() {
                ChannelPipeline p = Channels.pipeline();
                p.addLast("1", new LengthFieldBasedFrameDecoder(999999, 0, 4, 0, 4));
                p.addLast("2", new ChannelHandler(handoffQueue));

                return p;
            }
        });
View Full Code Here

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

    this.defaultInstance = defaultInstance;
  }

  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);
View Full Code Here

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

    }

    @Override
    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline p = Channels.pipeline();
        p.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(16 * 1024 * 1024, 0, 4, 0, 4));
        p.addLast("rpcDecoder", rpcDecoder);

        p.addLast("frameEncoder", frameEncoder);
        p.addLast("rpcEncoder", rpcEncoder);

View Full Code Here

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

    this.protocolName = protocolName;
  }

  public LengthFieldBasedFrameDecoder createLengthBasedFrameDecoder()
  {
    return new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 2, 0, 2);
  }
View Full Code Here

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

      return ((magic1 == LOG_IN || magic1 == RECONNECT) && magic2 == PROTCOL_VERSION);
    }

    public ChannelHandler createLengthBasedFrameDecoder()
    {
      return new LengthFieldBasedFrameDecoder(frameSize, 0, 2, 0, 2);
    }
View Full Code Here

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

  @Override
  public ChannelPipeline getPipeline() throws Exception
  {
    ChannelPipeline pipeline = Channels.pipeline();
    pipeline.addLast("lengthDecoder", new LengthFieldBasedFrameDecoder(
        Integer.MAX_VALUE, 0, 2, 0, 2));
    pipeline.addLast("eventDecoder", EVENT_DECODER);
    pipeline.addLast(DefaultToClientHandler.getName(),
        defaultToClientHandler);
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.