C# Class 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                            
Inheritance: ChannelHandlerAdapter
Afficher le fichier Open project: cdy816/mars

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
ChannelIdle ( IChannelHandlerContext context, DotNetty.Handlers.Timeout.IdleStateEvent stateEvent ) : void
ReadTimedOut ( IChannelHandlerContext context ) : void

Is called when a read timeout was detected.

Method Details

ChannelIdle() protected méthode

protected ChannelIdle ( IChannelHandlerContext context, DotNetty.Handlers.Timeout.IdleStateEvent stateEvent ) : void
context IChannelHandlerContext
stateEvent DotNetty.Handlers.Timeout.IdleStateEvent
Résultat void

ReadTimedOut() protected méthode

Is called when a read timeout was detected.
protected ReadTimedOut ( IChannelHandlerContext context ) : void
context IChannelHandlerContext Context.
Résultat void

ReadTimeoutHandler() public méthode

Initializes a new instance of the DotNetty.Handlers.Timeout.ReadTimeoutHandler class.
public ReadTimeoutHandler ( TimeSpan timeout ) : System
timeout TimeSpan Timeout.
Résultat System

ReadTimeoutHandler() public méthode

Initializes a new instance of the DotNetty.Handlers.Timeout.ReadTimeoutHandler class.
public ReadTimeoutHandler ( int timeoutSeconds ) : System
timeoutSeconds int Timeout in seconds.
Résultat System