add methods for sending data to FlowControlManager

This commit is contained in:
Marten Seemann
2016-06-16 10:55:34 +07:00
committed by Lucas Clemente
parent 9336245ddd
commit ac54ac66c7
6 changed files with 155 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ type FlowController interface {
AddBytesSent(n protocol.ByteCount)
UpdateSendWindow(newOffset protocol.ByteCount) bool
SendWindowSize() protocol.ByteCount
SendWindowOffset() protocol.ByteCount
UpdateHighestReceived(byteOffset protocol.ByteCount) protocol.ByteCount
IncrementHighestReceived(increment protocol.ByteCount)
AddBytesRead(n protocol.ByteCount)
@@ -18,8 +19,14 @@ type FlowController interface {
// A FlowControlManager manages the flow control
type FlowControlManager interface {
NewStream(streamID protocol.StreamID, contributesToConnectionFlow bool)
// methods needed for receiving data
UpdateHighestReceived(streamID protocol.StreamID, byteOffset protocol.ByteCount) error
AddBytesRead(streamID protocol.StreamID, n protocol.ByteCount) error
MaybeTriggerStreamWindowUpdate(streamID protocol.StreamID) (bool, protocol.ByteCount, error)
MaybeTriggerConnectionWindowUpdate() (bool, protocol.ByteCount)
// methods needed for sending data
AddBytesSent(streamID protocol.StreamID, n protocol.ByteCount) error
SendWindowSize(streamID protocol.StreamID) (protocol.ByteCount, error)
RemainingConnectionWindowSize() protocol.ByteCount
UpdateWindow(streamID protocol.StreamID, offset protocol.ByteCount) (bool, error)
}