BufferingFlowControlStrategy

<p> A flow control strategy that accumulates updates and emits window control frames when the accumulated value reaches a threshold. </p> <p> The sender flow control window is represented in the receiver as two buckets: a bigger bucket, initially full, that is drained when data is received, and a smaller bucket, initially empty, that is filled when data is consumed. Only the smaller bucket can refill the bigger bucket. </p> <p> The smaller bucket is defined as a fraction of the bigger bucket. </p> <p> For a more visual representation, see the <a href="http://en.wikipedia.org/wiki/Shishi-odoshi">rocking bamboo fountain</a>. </p> <p> The algorithm works in this way. </p> <p> The initial bigger bucket (BB) capacity is 100, and let's imagine the smaller bucket (SB) being 40% of the bigger bucket: 40. </p> <p> The receiver receives a data frame of 60, so now BB=40; the data frame is passed to the application that consumes 25, so now SB=25. Since SB is not full, no window control frames are emitted. </p> <p> The application consumes other 20, so now SB=45. Since SB is full, its 45 are transferred to BB, which is now BB=85, and a window control frame is sent with delta=45. </p> <p> The application consumes the remaining 15, so now SB=15, and no window control frame is emitted. </p>

Constructors

this
this(float bufferRatio)
Undocumented in source.
this
this(int initialStreamSendWindow, float bufferRatio)
Undocumented in source.

Members

Functions

getBufferRatio
float getBufferRatio()
Undocumented in source. Be warned that the author may not have intended to support it.
onDataConsumed
void onDataConsumed(SessionSPI session, StreamSPI stream, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
onStreamCreated
void onStreamCreated(StreamSPI stream)
Undocumented in source. Be warned that the author may not have intended to support it.
onStreamDestroyed
void onStreamDestroyed(StreamSPI stream)
Undocumented in source. Be warned that the author may not have intended to support it.
setBufferRatio
void setBufferRatio(float bufferRatio)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
windowUpdate
void windowUpdate(SessionSPI session, StreamSPI stream, WindowUpdateFrame frame)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From AbstractFlowControlStrategy

getInitialStreamSendWindow
int getInitialStreamSendWindow()
Undocumented in source. Be warned that the author may not have intended to support it.
getInitialStreamRecvWindow
int getInitialStreamRecvWindow()
Undocumented in source. Be warned that the author may not have intended to support it.
onStreamCreated
void onStreamCreated(StreamSPI stream)
Undocumented in source. Be warned that the author may not have intended to support it.
onStreamDestroyed
void onStreamDestroyed(StreamSPI stream)
Undocumented in source. Be warned that the author may not have intended to support it.
onDataConsumed
void onDataConsumed(SessionSPI session, StreamSPI stream, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
updateInitialStreamWindow
void updateInitialStreamWindow(SessionSPI session, int initialStreamWindow, bool local)
Undocumented in source. Be warned that the author may not have intended to support it.
onWindowUpdate
void onWindowUpdate(SessionSPI session, StreamSPI stream, WindowUpdateFrame frame)
Undocumented in source. Be warned that the author may not have intended to support it.
onDataReceived
void onDataReceived(SessionSPI session, StreamSPI stream, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
windowUpdate
void windowUpdate(SessionSPI session, StreamSPI stream, WindowUpdateFrame frame)
Undocumented in source. Be warned that the author may not have intended to support it.
onDataSending
void onDataSending(StreamSPI stream, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
onDataSent
void onDataSent(StreamSPI stream, int length)
Undocumented in source. Be warned that the author may not have intended to support it.
onSessionStalled
void onSessionStalled(SessionSPI session)
Undocumented in source. Be warned that the author may not have intended to support it.
onStreamStalled
void onStreamStalled(StreamSPI stream)
Undocumented in source. Be warned that the author may not have intended to support it.
onSessionUnstalled
void onSessionUnstalled(SessionSPI session)
Undocumented in source. Be warned that the author may not have intended to support it.
onStreamUnstalled
void onStreamUnstalled(StreamSPI stream)
Undocumented in source. Be warned that the author may not have intended to support it.
getSessionStallTime
long getSessionStallTime()
Undocumented in source. Be warned that the author may not have intended to support it.
getStreamsStallTime
long getStreamsStallTime()
Undocumented in source. Be warned that the author may not have intended to support it.
reset
void reset()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta