C# Класс DotNetty.Handlers.Timeout.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                            
Наследование: ChannelHandlerAdapter
Показать файл Открыть проект

Открытые методы

Метод Описание
ReadTimeoutHandler ( TimeSpan timeout ) : System

Initializes a new instance of the DotNetty.Handlers.Timeout.ReadTimeoutHandler class.

ReadTimeoutHandler ( int timeoutSeconds ) : System

Initializes a new instance of the DotNetty.Handlers.Timeout.ReadTimeoutHandler class.

Защищенные методы

Метод Описание
ChannelIdle ( IChannelHandlerContext context, DotNetty.Handlers.Timeout.IdleStateEvent stateEvent ) : void
ReadTimedOut ( IChannelHandlerContext context ) : void

Is called when a read timeout was detected.

Описание методов

ChannelIdle() защищенный Метод

protected ChannelIdle ( IChannelHandlerContext context, DotNetty.Handlers.Timeout.IdleStateEvent stateEvent ) : void
context IChannelHandlerContext
stateEvent DotNetty.Handlers.Timeout.IdleStateEvent
Результат void

ReadTimedOut() защищенный Метод

Is called when a read timeout was detected.
protected ReadTimedOut ( IChannelHandlerContext context ) : void
context IChannelHandlerContext Context.
Результат void

ReadTimeoutHandler() публичный Метод

Initializes a new instance of the DotNetty.Handlers.Timeout.ReadTimeoutHandler class.
public ReadTimeoutHandler ( TimeSpan timeout ) : System
timeout TimeSpan Timeout.
Результат System

ReadTimeoutHandler() публичный Метод

Initializes a new instance of the DotNetty.Handlers.Timeout.ReadTimeoutHandler class.
public ReadTimeoutHandler ( int timeoutSeconds ) : System
timeoutSeconds int Timeout in seconds.
Результат System