The C++ framework for developing highly scalable, high performance servers on Windows platforms.

IMonitorStreamSocketFlowControl Class Reference
[InterfacesMonitoringProtected destructors on abstract base classes]

Inheritance diagram for IMonitorStreamSocketFlowControl:

List of all members.


Detailed Description

An interface to allow a class to monitor the operation of a class that implements flow control for stream socket connections. The design of the interface assumes that only buffers that are affected by flow control are noted by the monitor. The effects of flow control on a buffer that is being sent on a connection are as follows: delayed, sent or discarded. A buffer that is delayed is being held for a while until it can be sent. A buffer that has been sent is a buffer that was previously delayed and that has now been written to the connection. A buffer that is discarded can either be a new buffer that is being discarded rather than delayed or an existing delayed buffer that will now never be sent. Incrementing a counter when OnBufferDelayed() is called and decrementing it when OnBufferSent() is called, OR when 'wasDelayed' is true and OnBufferDiscarded() is called will give you a count of buffers that are currently delayed. Incrementing a counter when OnBufferDiscarded() is called will give you a count of all the buffers that were discarded. You can use the 'id' value as a way of maintaining these counts on a per-connection basis. The Id that you return from a call to OnConnectionEstablished() will be passed with every call to the other monitor functions. Note that if all you require is a unique id per connection then you can simply cast the address of the supplied socket to a ConnectionId in OnConnectionEstablished() and return that.

Public Types

typedef ULONG_PTR ConnectionId

Public Member Functions

virtual ConnectionId OnConnectionEstablished (JetByteTools::Socket::IStreamSocket &socket)=0
virtual void OnWritePending (ConnectionId id)=0
virtual void OnWriteComplete (ConnectionId id)=0
virtual bool OnWriteCompletionError (ConnectionId id, JetByteTools::Socket::IStreamSocket &socket, JetByteTools::IO::IBuffer &buffer, DWORD lastError)=0
virtual void OnBufferDelayed (ConnectionId id, JetByteTools::IO::IBuffer &buffer)=0
virtual void OnConsolidation (ConnectionId id, bool consolidated)=0
virtual void OnBufferConsolidated (ConnectionId id, bool wasDelayed)=0
virtual void OnBufferSent (ConnectionId id, JetByteTools::IO::IBuffer &buffer)=0
virtual void OnBufferDiscarded (ConnectionId id, JetByteTools::IO::IBuffer &buffer, bool wasDelayed)=0
virtual void OnConnectionComplete (ConnectionId id)=0
virtual void OnConnectionTerminated (ConnectionId id)=0

Protected Member Functions

virtual ~IMonitorStreamSocketFlowControl ()
 We never delete instances of this interface; you must manage the lifetime of the class that implements it.

Member Typedef Documentation


Constructor & Destructor Documentation

virtual ~IMonitorStreamSocketFlowControl (  )  [protected, virtual]

We never delete instances of this interface; you must manage the lifetime of the class that implements it.


Member Function Documentation

virtual ConnectionId OnConnectionEstablished ( JetByteTools::Socket::IStreamSocket socket  )  [pure virtual]

virtual void OnWritePending ( ConnectionId  id  )  [pure virtual]

virtual void OnWriteComplete ( ConnectionId  id  )  [pure virtual]

virtual bool OnWriteCompletionError ( ConnectionId  id,
JetByteTools::Socket::IStreamSocket socket,
JetByteTools::IO::IBuffer &  buffer,
DWORD  lastError 
) [pure virtual]

virtual void OnBufferDelayed ( ConnectionId  id,
JetByteTools::IO::IBuffer &  buffer 
) [pure virtual]

virtual void OnConsolidation ( ConnectionId  id,
bool  consolidated 
) [pure virtual]

virtual void OnBufferConsolidated ( ConnectionId  id,
bool  wasDelayed 
) [pure virtual]

virtual void OnBufferSent ( ConnectionId  id,
JetByteTools::IO::IBuffer &  buffer 
) [pure virtual]

virtual void OnBufferDiscarded ( ConnectionId  id,
JetByteTools::IO::IBuffer &  buffer,
bool  wasDelayed 
) [pure virtual]

virtual void OnConnectionComplete ( ConnectionId  id  )  [pure virtual]

virtual void OnConnectionTerminated ( ConnectionId  id  )  [pure virtual]


Generated on Sun Sep 12 19:10:24 2021 for The Server Framework - v7.4 by doxygen 1.5.3