Package io.netty.handler.timeout

Examples of io.netty.handler.timeout.ReadTimeoutHandler$State


        // do we use request timeout?
        if (producer.getConfiguration().getRequestTimeout() > 0) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Using request timeout {} millis", producer.getConfiguration().getRequestTimeout());
            }
            ChannelHandler timeout = new ReadTimeoutHandler(producer.getConfiguration().getRequestTimeout(), TimeUnit.MILLISECONDS);
            addToPipeline("timeout", channelPipeline, timeout);
        }

        // our handler must be added last
        addToPipeline("handler", channelPipeline, new ClientChannelHandler(producer));
View Full Code Here


        if (producer.getConfiguration().getRequestTimeout() > 0) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Using request timeout {} millis", producer.getConfiguration().getRequestTimeout());
            }
            ChannelHandler timeout = new ReadTimeoutHandler(producer.getConfiguration().getRequestTimeout(), TimeUnit.MILLISECONDS);
            pipeline.addLast("timeout", timeout);
        }

        // handler to route Camel messages
        pipeline.addLast("handler", new HttpClientChannelHandler(producer));
View Full Code Here

        // do we use request timeout?
        if (producer.getConfiguration().getRequestTimeout() > 0) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Using request timeout {} millis", producer.getConfiguration().getRequestTimeout());
            }
            ChannelHandler timeout = new ReadTimeoutHandler(producer.getConfiguration().getRequestTimeout(), TimeUnit.MILLISECONDS);
            addToPipeline("timeout", channelPipeline, timeout);
        }

        // our handler must be added last
        addToPipeline("handler", channelPipeline, new ClientChannelHandler(producer));
View Full Code Here

            promise.addListener(new ChannelFutureListener() {
                @Override
                public void operationComplete(ChannelFuture future) throws Exception {
                    ChannelHandler timeoutHandler = ctx.pipeline().get(READ_TIMEOUT_HANDLER_NAME);
                    if (null == timeoutHandler) {
                        ctx.pipeline().addFirst(READ_TIMEOUT_HANDLER_NAME, new ReadTimeoutHandler(timeout, timeUnit));
                    } else {
                        // This will always be invoked from the eventloop as it is a future listener callback.
                        ChannelHandlerContext handlerContext = ctx.pipeline().context(timeoutHandler);
                        timeoutHandler.handlerAdded(handlerContext);
                    }
View Full Code Here

        // Configure the pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {

            private final ChannelHandler timeoutHandler =
                new ReadTimeoutHandler(timer, READ_TIMEOUT);
            private final ChannelHandler uptimeHandler =
                new UptimeClientHandler(bootstrap, timer);

            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(
View Full Code Here

                    ChannelPipeline p = ch.pipeline();
                    if (sslContext != null) {
                        p.addLast(sslContext.newHandler(ch.alloc()));
                    }
                    // WriteTimeoutHandler & ReadTimeoutHandler
                    p.addLast("readTimeoutHandler", new ReadTimeoutHandler(
                            readTimeoutMs, TimeUnit.MILLISECONDS));
                    p.addLast(new StringEncoder(CharsetUtil.UTF_8));
                    p.addLast(new SnappyFramedDecoder(true));
                    p.addLast(new RecordIdDecoder(store));
                    p.addLast(executor, handler);
View Full Code Here

        channelManager.addChannel(channel);
        channel.getP2pHandler().activate();

        ch.pipeline().addLast("readTimeoutHandler",
                new ReadTimeoutHandler(CONFIG.peerChannelReadTimeout(), TimeUnit.SECONDS));
        ch.pipeline().addLast("out encoder", messageEncoder);
        ch.pipeline().addLast("in  encoder", messageDecoder);
        ch.pipeline().addLast(Capability.P2P, channel.getP2pHandler());
        ch.pipeline().addLast(Capability.ETH, channel.getEthHandler());
        ch.pipeline().addLast(Capability.SHH, channel.getShhHandler());
View Full Code Here

                        protected void initChannel(NioSocketChannel ch) throws Exception {

                            logger.info("Open connection, channel: {}", ch.toString());

                            ch.pipeline().addLast("readTimeoutHandler",
                                    new ReadTimeoutHandler(CONFIG.peerChannelReadTimeout(), TimeUnit.SECONDS));
                            ch.pipeline().addLast("out encoder", encoder);
                            ch.pipeline().addLast("in  encoder", decoder);
                            ch.pipeline().addLast(Capability.P2P, p2pHandler);
                            ch.pipeline().addLast(Capability.ETH, ethHandler);
                            ch.pipeline().addLast(Capability.SHH, shhHandler);
View Full Code Here

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

            p.addLast("codec", new HttpClientCodec());
            p.addLast("aggregator", new HttpObjectAggregator(maxContentLengthBytes));
            p.addLast("readTimeout", new ReadTimeoutHandler(requestParams.readTimeoutNanos, TimeUnit.NANOSECONDS));
            p.addLast("handler", new SimpleChannelInboundHandler<HttpObject>(false) {
              @Override
              public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
                if (msg instanceof FullHttpResponse) {
                  final FullHttpResponse response = (FullHttpResponse) msg;
View Full Code Here

            {
                // IP_TOS is not supported (Windows XP / Windows Server 2003)
            }
            ch.config().setAllocator( PooledByteBufAllocator.DEFAULT );

            ch.pipeline().addLast( TIMEOUT_HANDLER, new ReadTimeoutHandler( BungeeCord.getInstance().config.getTimeout(), TimeUnit.MILLISECONDS ) );
            ch.pipeline().addLast( FRAME_DECODER, new Varint21FrameDecoder() );
            ch.pipeline().addLast( FRAME_PREPENDER, framePrepender );

            ch.pipeline().addLast( BOSS_HANDLER, new HandlerBoss() );
        }
View Full Code Here

TOP

Related Classes of io.netty.handler.timeout.ReadTimeoutHandler$State

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.