ReadTimeoutHandler |
Raises a ReadTimeoutException when no data was read within a certain period of time. The connection is closed when there is no inbound traffic for 30 seconds. var bootstrap = new DotNetty.Transport.Bootstrapping.ServerBootstrap(); bootstrap.ChildHandler(new ActionChannelInitializer(channel => { IChannelPipeline pipeline = channel.Pipeline; pipeline.AddLast("readTimeoutHandler", new ReadTimeoutHandler(30); pipeline.AddLast("myHandler", new MyHandler()); } public class MyHandler : ChannelDuplexHandler { public override void ExceptionCaught(IChannelHandlerContext context, Exception exception) { if(exception is ReadTimeoutException) { // do somethind } else { base.ExceptionCaught(context, cause); } } } WriteTimeoutHandler IdleStateHandler |