Added comment on flow control policy.

This commit is contained in:
Simone Bordet 2012-02-28 23:47:06 +01:00
parent 17bb26f053
commit 9575e8a7d2
1 changed files with 10 additions and 0 deletions

View File

@ -201,6 +201,16 @@ public class StandardStream implements IStream
public void consume(int delta)
{
super.consume(delta);
// This is the algorithm for flow control.
// This method may be called multiple times
// with delta=1, but we only send a window
// update when the whole dataInfo has been
// consumed.
// Other policies may be to send window
// updates when consumed() is greater than
// a certain threshold, etc. but for now
// the policy is not pluggable for simplicity.
if (consumed() == length() && !isClosed())
windowUpdate(length());
}