Example usage for io.netty.channel ChannelHandlerContext fireChannelInactive

List of usage examples for io.netty.channel ChannelHandlerContext fireChannelInactive

Introduction

In this page you can find the example usage for io.netty.channel ChannelHandlerContext fireChannelInactive.

Prototype

@Override
    ChannelHandlerContext fireChannelInactive();

Source Link

Usage

From source file:code.google.nfs.rpc.netty.serialize.NettyProtocolDecoder.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    RecyclableArrayList out = RecyclableArrayList.newInstance();
    try {//from  w  w  w. jav  a2  s .co  m
        if (cumulation != null) {
            callDecode(ctx, cumulation, out);
            decodeLast(ctx, cumulation, out);
        } else {
            decodeLast(ctx, Unpooled.EMPTY_BUFFER, out);
        }
    } catch (DecoderException e) {
        throw e;
    } catch (Exception e) {
        throw new DecoderException(e);
    } finally {
        if (cumulation != null) {
            cumulation.release();
            cumulation = null;
        }

        for (int i = 0; i < out.size(); i++) {
            ctx.fireChannelRead(out.get(i));
        }
        ctx.fireChannelInactive();
    }
}

From source file:com.alibaba.dubbo.remoting.transport.netty.NettyClientHandler.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    ctx.fireChannelInactive();
}

From source file:com.barchart.netty.common.pipeline.PingHandler.java

License:BSD License

@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {

    stopPing();//from   w w w. ja va2  s.  c om

    ctx.fireChannelInactive();

}

From source file:com.barchart.netty.server.http.pipeline.HttpRequestChannelHandler.java

License:BSD License

@Override
public void channelInactive(final ChannelHandlerContext ctx) {

    requestComplete(ctx);

    ctx.fireChannelInactive();

}

From source file:com.basho.riak.client.core.netty.HealthCheckDecoder.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    logger.debug("Healthcheck channel went inactive");
    future.setException(new IOException("Channel closed while performing health check op."));
    ctx.fireChannelInactive();
}

From source file:com.basho.riak.client.core.netty.RiakSecurityDecoder.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    promise.tryFailure(new IOException("Channel closed during auth"));
    ctx.fireChannelInactive();

}

From source file:com.caricah.iotracah.server.netty.TimeoutHandler.java

License:Apache License

@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
    super.userEventTriggered(ctx, evt);
    if (evt instanceof IdleStateEvent) {
        IdleState e = ((IdleStateEvent) evt).state();
        if (e == IdleState.ALL_IDLE) {
            //fire a channelInactive to trigger publish of Will
            ctx.fireChannelInactive();
            ctx.close();//from   w ww  . j  a  v a2 s  .  com
        }
    }
}

From source file:com.chenyang.proxy.http.HttpRelayHandler.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    if (relayChannel != null && relayChannel.isActive()) {
        relayChannel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
    }/*  w w w .  ja  va  2  s  .  c  o  m*/
    ctx.fireChannelInactive();
}

From source file:com.chenyang.proxy.http.HttpRemoteForwardHandler.java

License:Apache License

@Override
public void channelInactive(final ChannelHandlerContext remoteChannelCtx) throws Exception {

    final String remoteAddr = uaChannel.attr(HttpConnectionAttribute.ATTRIBUTE_KEY).get().getRemote()
            .getRemoteAddr();/*from   w  w w.  ja va  2  s .co  m*/

    remoteChannelInactiveCallback.remoteChannelInactive(uaChannel, remoteAddr);

    remoteChannelCtx.fireChannelInactive();

}

From source file:com.couchbase.client.core.endpoint.AbstractGenericHandler.java

License:Apache License

@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
    LOGGER.debug(logIdent(ctx, endpoint) + "Channel Inactive.");
    endpoint.notifyChannelInactive();/* ww w  .j a va2 s . c  o m*/
    ctx.fireChannelInactive();
}