GeezerVison is showing netty.io — IdleStateHandler (Netty API Reference (4.1.141.Final))
Class IdleStateHandler
-
-
Constructor Summary
Constructors
Constructor
Description
IdleStateHandler(int readerIdleTimeSeconds,
int writerIdleTimeSeconds,
int allIdleTimeSeconds)
-
Method Summary
Modifier and Type
Method
Description
void
protected void
void
void
void
void
long
Return the allIdleTime that was given when instance this class in milliseconds.
long
Return the readerIdleTime that was given when instance this class in milliseconds.
long
Return the writerIdleTime that was given when instance this class in milliseconds.
void
Do nothing by default, sub-classes may override this method.
void
Do nothing by default, sub-classes may override this method.
void
void
void
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
IdleStateHandler
public IdleStateHandler(int readerIdleTimeSeconds,
int writerIdleTimeSeconds,
int allIdleTimeSeconds)
- Parameters:
readerIdleTimeSeconds - an IdleStateEvent whose state is IdleState.READER_IDLE
will be triggered when no read was performed for the specified
period of time. Specify 0 to disable.
writerIdleTimeSeconds - an IdleStateEvent whose state is IdleState.WRITER_IDLE
will be triggered when no write was performed for the specified
period of time. Specify 0 to disable.
allIdleTimeSeconds - an IdleStateEvent whose state is IdleState.ALL_IDLE
will be triggered when neither read nor write was performed for
the specified period of time. Specify 0 to disable.
-
IdleStateHandler
public IdleStateHandler(long readerIdleTime,
long writerIdleTime,
long allIdleTime,
TimeUnit unit)
- See Also:
-
-
IdleStateHandler
public IdleStateHandler(boolean observeOutput,
long readerIdleTime,
long writerIdleTime,
long allIdleTime,
TimeUnit unit)
- Parameters:
observeOutput - whether or not the consumption of bytes should be taken into
consideration when assessing write idleness. The default is false.
readerIdleTime - an IdleStateEvent whose state is IdleState.READER_IDLE
will be triggered when no read was performed for the specified
period of time. Specify 0 to disable.
writerIdleTime - an IdleStateEvent whose state is IdleState.WRITER_IDLE
will be triggered when no write was performed for the specified
period of time. Specify 0 to disable.
allIdleTime - an IdleStateEvent whose state is IdleState.ALL_IDLE
will be triggered when neither read nor write was performed for
the specified period of time. Specify 0 to disable.
unit - the TimeUnit of readerIdleTime,
writeIdleTime, and allIdleTime
-
Method Details
-
getReaderIdleTimeInMillis
public long getReaderIdleTimeInMillis()
Return the readerIdleTime that was given when instance this class in milliseconds.
-
getWriterIdleTimeInMillis
public long getWriterIdleTimeInMillis()
Return the writerIdleTime that was given when instance this class in milliseconds.
-
getAllIdleTimeInMillis
public long getAllIdleTimeInMillis()
Return the allIdleTime that was given when instance this class in milliseconds.
-
-
-
-
-
-
-
-
-
resetReadTimeout
public void resetReadTimeout()
Reset the read timeout. As this handler is not thread-safe, this method must be called on the event loop.
-
resetWriteTimeout
public void resetWriteTimeout()
Reset the write timeout. As this handler is not thread-safe, this method must be called on the event loop.
-
-
|