Package io.netty.handler.codec.http2
Interface DefaultHttp2LocalFlowController.FlowState
-
- All Known Implementing Classes:
DefaultHttp2LocalFlowController.AutoRefillState,DefaultHttp2LocalFlowController.DefaultState
- Enclosing class:
- DefaultHttp2LocalFlowController
private static interface DefaultHttp2LocalFlowController.FlowStateAn abstraction which provides specific extensions used by local flow control.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanconsumeBytes(int numBytes)Indicates that the application has consumednumBytesfrom the connection or stream and is ready to receive more data.voidendOfStream(boolean endOfStream)voidincrementFlowControlWindows(int delta)Increment the windows which are used to determine many bytes have been processed.voidincrementInitialStreamWindow(int delta)Increment the initial window size for this stream.intinitialWindowSize()voidreceiveFlowControlledFrame(int dataLength)A flow control event has occurred and we should decrement the amount of available bytes for this stream.intunconsumedBytes()voidwindow(int initialWindowSize)intwindowSize()floatwindowUpdateRatio()voidwindowUpdateRatio(float ratio)booleanwriteWindowUpdateIfNeeded()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 Http2ExceptionUpdates the flow control window for this stream if it is appropriate.- Returns:
- true if
WINDOW_UPDATEwas written, false otherwise. - Throws:
Http2Exception
-
consumeBytes
boolean consumeBytes(int numBytes) throws Http2ExceptionIndicates that the application has consumednumBytesfrom 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_UPDATEwas written, false otherwise. - Throws:
Http2Exception
-
unconsumedBytes
int unconsumedBytes()
-
windowUpdateRatio
float windowUpdateRatio()
-
windowUpdateRatio
void windowUpdateRatio(float ratio)
-
receiveFlowControlledFrame
void receiveFlowControlledFrame(int dataLength) throws Http2ExceptionA 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 Http2ExceptionIncrement 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)
-
-