CReadTimeoutStreamSocketConnectionFilter Class Reference
[Filtering]

Inheritance diagram for CReadTimeoutStreamSocketConnectionFilter:

Inheritance graph
[legend]
Collaboration diagram for CReadTimeoutStreamSocketConnectionFilter:

Collaboration graph
[legend]

List of all members.


Detailed Description

A connection filter that filters supplied read timeout functionality. A call to SetReadTimeout() on a socket will set a timeout for every read operation that is issued on the socket. If the timeout expires then the TimerCallback::OnTimer() method of the callback that was passed to the call to SetReadTimeout() is called with the socket and user data. If you require different user data and/or timer callbacks for a particular timeout then you can call SetSingleReadTimeout() to specify this information. Normal usage is to call SetReadTimeout() when the connection is established and then, possibly, call SetSingleReadTimeout() when the 'default' timeout occurs on a socket to change the timeout parameters from this point on... Call CancelReadTimeout() to stop setting timeouts on all future reads (and to cancel any currently pending timeout) and CancelPendingTimeout() to just cancel any currently pending timeouts but to continue to set timeouts on all subsequent read operations.


Public Types

typedef
JetByteTools::Win32::IQueueTimers::UserData 
UserData
 User data that can be passed to the TimerCallback::OnTimer() call.

Public Member Functions

 CReadTimeoutStreamSocketConnectionFilter (IAcceptStreamSocketConnectionFilters &manager, IAllocateStreamSockets &socketAllocator, JetByteTools::Win32::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.
void SetReadTimeout (IStreamSocket &socket, const Milliseconds timeout, TimerCallback &timerCallback, const UserData userData=0)
 Sets a read timeout on the socket. The timeout will be set after every read is issued on the socket.
void SetSingleReadTimeout (IStreamSocket &socket, const Milliseconds timeout, TimerCallback &timerCallback, const 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 CancelReadTimeout (IStreamSocket &socket)
 Cancels any pending timeouts and prevents any more timeouts being set for any subsequent read operations on the supplied socket.
void CancelPendingTimeout (IStreamSocket &socket)
 Cancels any pending timeouts on the supplied socket.

Classes

class  TimerCallback


Member Typedef Documentation

typedef JetByteTools::Win32::IQueueTimers::UserData UserData

User data that can be passed to the TimerCallback::OnTimer() call.

Reimplemented from IQueueTimers::Timer.


Constructor & Destructor Documentation

CReadTimeoutStreamSocketConnectionFilter ( IAcceptStreamSocketConnectionFilters manager,
IAllocateStreamSockets socketAllocator,
JetByteTools::Win32::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.


Member Function Documentation

void SetReadTimeout ( IStreamSocket socket,
const Milliseconds  timeout,
TimerCallback timerCallback,
const UserData  userData = 0 
)

Sets a read timeout on the socket. The timeout will be set after every read is issued on the socket.

void SetSingleReadTimeout ( IStreamSocket socket,
const Milliseconds  timeout,
TimerCallback timerCallback,
const 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 CancelReadTimeout ( IStreamSocket socket  ) 

Cancels any pending timeouts and prevents any more timeouts being set for any subsequent read operations on the supplied socket.

void CancelPendingTimeout ( IStreamSocket socket  ) 

Cancels any pending timeouts on the supplied socket.


Generated on Thu Mar 26 16:40:11 2009 for JetByte Socket Tools - v6.0 by  doxygen 1.5.3