Example usage for io.netty.channel ChannelHandler handlerRemoved

List of usage examples for io.netty.channel ChannelHandler handlerRemoved

Introduction

In this page you can find the example usage for io.netty.channel ChannelHandler handlerRemoved.

Prototype

void handlerRemoved(ChannelHandlerContext ctx) throws Exception;

Source Link

Document

Gets called after the ChannelHandler was removed from the actual context and it doesn't handle events anymore.

Usage

From source file:io.reactivex.netty.pipeline.ReadTimeoutPipelineConfigurator.java

License:Apache License

private static void disableHandler(ChannelHandler timeoutHandler, ChannelHandlerContext handlerContext) {
    try {// w  w  w .  j  av  a2  s.c o  m
        timeoutHandler.handlerRemoved(handlerContext);
    } catch (Exception e) {
        logger.error("Failed to remove readtimeout handler. This connection will be discarded.", e);
        handlerContext.channel().attr(ClientRequestResponseConverter.DISCARD_CONNECTION).set(true);
    }
}