TimeoutAdapter

Fires an event handler or disconnects connections after a period of inactivity.

Constructors

this
this(IConnection next)
Undocumented in source.

Members

Functions

cancelIdleTimeout
void cancelIdleTimeout()

Stop the idle timer.

markNonIdle
void markNonIdle()

Manually mark this connection as non-idle, restarting the idle timer. handleNonIdle will be called, if set.

onConnect
void onConnect()
Undocumented in source. Be warned that the author may not have intended to support it.
onDisconnect
void onDisconnect(string reason, DisconnectType type)
Undocumented in source. Be warned that the author may not have intended to support it.
onReadData
void onReadData(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
resumeIdleTimeout
void resumeIdleTimeout()

Restart the idle timer.

setIdleTimeout
void setIdleTimeout(Duration timeout)

Set the Duration indicating the period of inactivity after which to take action.

when
auto when()

Returns the point in time when the idle handler is scheduled to be called, or null if it is not scheduled.

Variables

handleIdleTimeout
void delegate() handleIdleTimeout;

Callback for when a connection has stopped responding. If unset, the connection will be disconnected.

handleNonIdle
void delegate() handleNonIdle;

Callback for when a connection is marked as non-idle (when data is received).

Inherited Members

From ConnectionAdapter

next
IConnection next;

The next connection in the chain (towards the raw transport).

state
ConnectionState state [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
send
void send(Data[] data, int priority)

Queue Data for sending.

send
alias send = IConnection.send
Undocumented in source.
disconnect
void disconnect(string reason, DisconnectType type)

Terminate the connection.

onConnect
void onConnect()
Undocumented in source. Be warned that the author may not have intended to support it.
onReadData
void onReadData(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
onDisconnect
void onDisconnect(string reason, DisconnectType type)
Undocumented in source. Be warned that the author may not have intended to support it.
onBufferFlushed
void onBufferFlushed()
Undocumented in source. Be warned that the author may not have intended to support it.
handleConnect
ConnectHandler handleConnect [@property setter]

Callback for when a connection has been established.

connectHandler
ConnectHandler connectHandler;
Undocumented in source.
handleReadData
ReadDataHandler handleReadData [@property setter]

Callback setter for when new data is read.

readDataHandler
ReadDataHandler readDataHandler;
Undocumented in source.
handleDisconnect
DisconnectHandler handleDisconnect [@property setter]

Callback setter for when a connection was closed.

disconnectHandler
DisconnectHandler disconnectHandler;
Undocumented in source.
handleBufferFlushed
BufferFlushedHandler handleBufferFlushed [@property setter]

Callback setter for when all queued data has been written.

bufferFlushedHandler
BufferFlushedHandler bufferFlushedHandler;
Undocumented in source.

Meta