Package io.netty.handler.codec.http2
Interface DefaultHttp2LocalFlowController.FlowState
-
- All Known Implementing Classes:
DefaultHttp2LocalFlowController.AutoRefillState
,DefaultHttp2LocalFlowController.DefaultState
- Enclosing class:
- DefaultHttp2LocalFlowController
private static interface DefaultHttp2LocalFlowController.FlowState
An abstraction which provides specific extensions used by local flow control.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
consumeBytes(int numBytes)
Indicates that the application has consumednumBytes
from the connection or stream and is ready to receive more data.void
endOfStream(boolean endOfStream)
void
incrementFlowControlWindows(int delta)
Increment the windows which are used to determine many bytes have been processed.void
incrementInitialStreamWindow(int delta)
Increment the initial window size for this stream.int
initialWindowSize()
void
receiveFlowControlledFrame(int dataLength)
A flow control event has occurred and we should decrement the amount of available bytes for this stream.int
unconsumedBytes()
void
window(int initialWindowSize)
int
windowSize()
float
windowUpdateRatio()
void
windowUpdateRatio(float ratio)
boolean
writeWindowUpdateIfNeeded()
Updates the flow control window for this stream if it is appropriate.
-
-
-
Method Detail
-
windowSize
int windowSize()
-
initialWindowSize
int initialWindowSize()
-
window
void window(int initialWindowSize)
-
incrementInitialStreamWindow
void incrementInitialStreamWindow(int delta)
Increment the initial window size for this stream.- Parameters:
delta
- The amount to increase the initial window size by.
-
writeWindowUpdateIfNeeded
boolean writeWindowUpdateIfNeeded() throws Http2Exception
Updates the flow control window for this stream if it is appropriate.- Returns:
- true if
WINDOW_UPDATE
was written, false otherwise. - Throws:
Http2Exception
-
consumeBytes
boolean consumeBytes(int numBytes) throws Http2Exception
Indicates that the application has consumednumBytes
from the connection or stream and is ready to receive more data.- Parameters:
numBytes
- the number of bytes to be returned to the flow control window.- Returns:
- true if
WINDOW_UPDATE
was written, false otherwise. - Throws:
Http2Exception
-
unconsumedBytes
int unconsumedBytes()
-
windowUpdateRatio
float windowUpdateRatio()
-
windowUpdateRatio
void windowUpdateRatio(float ratio)
-
receiveFlowControlledFrame
void receiveFlowControlledFrame(int dataLength) throws Http2Exception
A flow control event has occurred and we should decrement the amount of available bytes for this stream.- Parameters:
dataLength
- The amount of data to for which this stream is no longer eligible to use for flow control.- Throws:
Http2Exception
- If too much data is used relative to how much is available.
-
incrementFlowControlWindows
void incrementFlowControlWindows(int delta) throws Http2Exception
Increment the windows which are used to determine many bytes have been processed.- Parameters:
delta
- The amount to increment the window by.- Throws:
Http2Exception
- if integer overflow occurs on the window.
-
endOfStream
void endOfStream(boolean endOfStream)
-
-