Public Types | |
typedef JetByteTools::Core::IQueueTimers::UserData | UserData |
User data that can be passed to the TimerCallback::OnTimer() call. | |
Public Member Functions | |
CReadTimeoutStreamSocketConnectionFilter (IAcceptStreamSocketConnectionFilters &manager, JetByteTools::Core::IQueueTimers &timerQueue) | |
Installs the connection filter on all connections made by the supplied manager and allocates space for timer data in all sockets allocated by the supplied socket allocator and queues timers using the supplied timer queue. | |
CReadTimeoutStreamSocketConnectionFilter (const CReadTimeoutStreamSocketConnectionFilter &rhs) | |
CReadTimeoutStreamSocketConnectionFilter & | operator= (const CReadTimeoutStreamSocketConnectionFilter &rhs) |
void | SetupReadTimeout (IStreamSocket &socket, Milliseconds timeout, TimerCallback &timerCallback, UserData userData=0) const |
Sets up a read timeout for the socket. The timeout will be set after every read is issued on the socket. Note that the timeout is NOT set until the next read is issued. | |
void | SetReadTimeout (IStreamSocket &socket, Milliseconds timeout, TimerCallback &timerCallback, UserData userData=0) |
Sets a read timeout on the socket. The timeout will be set after every read is issued on the socket. Note that the timeout is set straight away but will be reset when the next read is issued. | |
void | SetSingleReadTimeout (IStreamSocket &socket, Milliseconds timeout, TimerCallback &timerCallback, UserData userData=0) |
Sets a single read timeout on the socket. This can be used to set a different timeout to the 'default' timeout that is set with all read operations. Note that there's only one timeout per socket and setting this timeout cancels any pending 'default' read timeout that may have been set when the last read was issued. Usually called from the TimerCallback::OnTimer() handler to set an additional timeout after the 'default' timeout has expired. | |
void | SetDisconnectTimeout (IStreamSocket &socket, Milliseconds timeout, TimerCallback &timerCallback, UserData userData=0) |
Sets a disconnect timeout on the socket. The timeout is set once and no further timeouts can be set. Note that the timeout is set straight away and does NOT get reset by read completions. The timer WILL fire when it expires unless the connection has already been disconnected. | |
void | CancelReadTimeout (IStreamSocket &socket) const |
Cancels any pending timeouts and prevents any more timeouts being set for any subsequent read operations on the supplied socket. | |
void | CancelPendingTimeout (IStreamSocket &socket) const |
Cancels any pending timeouts on the supplied socket. | |
Classes | |
class | TimerCallback |
User data that can be passed to the TimerCallback::OnTimer() call.
Reimplemented from IQueueTimers::Timer.
CReadTimeoutStreamSocketConnectionFilter | ( | IAcceptStreamSocketConnectionFilters & | manager, | |
JetByteTools::Core::IQueueTimers & | timerQueue | |||
) |
Installs the connection filter on all connections made by the supplied manager and allocates space for timer data in all sockets allocated by the supplied socket allocator and queues timers using the supplied timer queue.
CReadTimeoutStreamSocketConnectionFilter& operator= | ( | const CReadTimeoutStreamSocketConnectionFilter & | rhs | ) |
void SetupReadTimeout | ( | IStreamSocket & | socket, | |
Milliseconds | timeout, | |||
TimerCallback & | timerCallback, | |||
UserData | userData = 0 | |||
) | const |
Sets up a read timeout for the socket. The timeout will be set after every read is issued on the socket. Note that the timeout is NOT set until the next read is issued.
void SetReadTimeout | ( | IStreamSocket & | socket, | |
Milliseconds | timeout, | |||
TimerCallback & | timerCallback, | |||
UserData | userData = 0 | |||
) |
Sets a read timeout on the socket. The timeout will be set after every read is issued on the socket. Note that the timeout is set straight away but will be reset when the next read is issued.
void SetSingleReadTimeout | ( | IStreamSocket & | socket, | |
Milliseconds | timeout, | |||
TimerCallback & | timerCallback, | |||
UserData | userData = 0 | |||
) |
Sets a single read timeout on the socket. This can be used to set a different timeout to the 'default' timeout that is set with all read operations. Note that there's only one timeout per socket and setting this timeout cancels any pending 'default' read timeout that may have been set when the last read was issued. Usually called from the TimerCallback::OnTimer() handler to set an additional timeout after the 'default' timeout has expired.
void SetDisconnectTimeout | ( | IStreamSocket & | socket, | |
Milliseconds | timeout, | |||
TimerCallback & | timerCallback, | |||
UserData | userData = 0 | |||
) |
Sets a disconnect timeout on the socket. The timeout is set once and no further timeouts can be set. Note that the timeout is set straight away and does NOT get reset by read completions. The timer WILL fire when it expires unless the connection has already been disconnected.
void CancelReadTimeout | ( | IStreamSocket & | socket | ) | const |
Cancels any pending timeouts and prevents any more timeouts being set for any subsequent read operations on the supplied socket.
void CancelPendingTimeout | ( | IStreamSocket & | socket | ) | const |
Cancels any pending timeouts on the supplied socket.