Package org.jboss.netty.handler.timeout

Examples of org.jboss.netty.handler.timeout.ReadTimeoutHandler


        }
    }

    private ChannelFuture closeChannel(Channel c) {
        LOG.debug("Closing channel {}", c);
        ReadTimeoutHandler timeout = c.getPipeline().get(ReadTimeoutHandler.class);
        if (timeout != null) {
            timeout.releaseExternalResources();
        }
        return c.close();
    }
View Full Code Here


     */
    @Override
    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = Channels.pipeline();

        pipeline.addLast("readTimeout", new ReadTimeoutHandler(new HashedWheelTimer(),
                                                               conf.getReadTimeout()));
        pipeline.addLast("lengthbasedframedecoder", new LengthFieldBasedFrameDecoder(MAX_FRAME_LENGTH, 0, 4, 0, 4));
        pipeline.addLast("mainhandler", this);
        return pipeline;
    }
View Full Code Here

    public ChannelPipeline getPipeline() throws Exception {
        if (timeOut > 0)
            return Channels.pipeline(
                    // new GameBytesCounter(),
                    // new GameEventCounter(),
                    new ReadTimeoutHandler(timeoutHandler, timeOut), // timeout断开连接
                    new FlashCrossDomainDecoder(), new GameDecoder(maxReadSize, 0, GameBufferFactory.getReadHeaderSize(), 0, readOffset),
                    new GameEncoder(),
                    new GameUpStreamer());
        else {
            return Channels.pipeline(
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(NettyComponent.getTimer(), 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

TOP

Related Classes of org.jboss.netty.handler.timeout.ReadTimeoutHandler

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.