Examples of LengthFieldPrepender


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

        if (channelManager.getSslFactory() != null) {
            pipeline.addLast("ssl", new SslHandler(channelManager.getSslFactory().getEngine()));
        }
        pipeline.addLast("lengthbaseddecoder", new LengthFieldBasedFrameDecoder(
                         cfg.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", createHChannelHandler());
View Full Code Here

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

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

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

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

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

        return new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline()
                    throws Exception {
                ChannelPipeline cp = Channels.pipeline();
                cp.addLast("frameEncoder", new LengthFieldPrepender(LENGTH_FIELD_LENGTH));
                cp.addLast(
                        "frameDecoder",
                        new LengthFieldBasedFrameDecoder(
                                maxFrameSize,
                                LENGTH_FIELD_OFFSET,
View Full Code Here

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

    @Override
    public ChannelPipeline getPipeline() throws Exception {
        final ChannelPipeline pipeline = Channels.pipeline();
        pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder((int) ((1L << (lengthFieldSize * 8)) - 1) & (-1 >>> 1), 0, lengthFieldSize, 0, lengthFieldSize));
        pipeline.addLast("frameEncoder", new LengthFieldPrepender(lengthFieldSize, false));
        if (executor != null)
            pipeline.addLast("executor", new ExecutionHandler(executor));
        pipeline.addLast("logging", new LoggingHandler(logger));
        // a node resolver must be added before the mesage codec
        pipeline.addLast("messageCodec", new MessageCodec());
View Full Code Here

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

    @Override
    public ChannelPipeline getPipeline() throws Exception {
        final ChannelPipeline pipeline = Channels.pipeline();
        pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder((int) ((1L << (lengthFieldSize * 8)) - 1) & (-1 >>> 1), 0, lengthFieldSize, 0, lengthFieldSize));
        pipeline.addLast("frameEncoder", new LengthFieldPrepender(lengthFieldSize, false));
        if (executor != null)
            pipeline.addLast("executor", new ExecutionHandler(executor));
        pipeline.addLast("logging", new LoggingHandler(logger));
        // a node resolver must be added before the mesage codec
        pipeline.addLast("messageCodec", new MessageCodec());
View Full Code Here

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

        p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());

        p.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
        p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));

        p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
        p.addLast("deflateEncoder", new ZlibEncoder());
        p.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
        p.addLast("protobufEncoder", new ProtobufEncoder());

        p.addLast("authenticationHandler", new ServerHandshakeHandler());
View Full Code Here

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

        return new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline()
                    throws Exception {
                ChannelPipeline cp = Channels.pipeline();
                cp.addLast("frameEncoder", new LengthFieldPrepender(LENGTH_FIELD_LENGTH));
                cp.addLast(
                        "frameDecoder",
                        new LengthFieldBasedFrameDecoder(
                                maxFrameSize,
                                LENGTH_FIELD_OFFSET,
View Full Code Here

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

            @Override
            public ChannelPipeline getPipeline()
                    throws Exception {
                ChannelPipeline cp = Channels.pipeline();
                TimeoutHandler.addToPipeline(cp);
                cp.addLast("frameEncoder", new LengthFieldPrepender(LENGTH_FIELD_LENGTH));
                cp.addLast(
                        "frameDecoder",
                        new LengthFieldBasedFrameDecoder(
                                maxFrameSize,
                                LENGTH_FIELD_OFFSET,
View Full Code Here

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

   
    public static void addLengthFieldPipes( ChannelPipeline pipeline )
    {
        pipeline.addLast( "frameDecoder",
                new LengthFieldBasedFrameDecoder( MAX_FRAME_LENGTH+4, 0, 4, 0, 4 ) );
        pipeline.addLast( "frameEncoder", new LengthFieldPrepender( 4 ) );
    }
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.