Interface Http2FlowController
-
- All Known Subinterfaces:
Http2LocalFlowController,Http2RemoteFlowController
- All Known Implementing Classes:
DefaultHttp2LocalFlowController,DefaultHttp2RemoteFlowController
public interface Http2FlowControllerBase interface for all HTTP/2 flow controllers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidchannelHandlerContext(ChannelHandlerContext ctx)Set theChannelHandlerContextfor which to apply flow control on.voidincrementWindowSize(Http2Stream stream, int delta)Increments the size of the stream's flow control window by the given delta.intinitialWindowSize()Gets the connection-wide initial flow control window size that is used as the basis for new stream flow control windows.voidinitialWindowSize(int newWindowSize)Sets the connection-wide initial flow control window and updates all stream windows (but not the connection stream window) by the delta.intwindowSize(Http2Stream stream)Get the portion of the flow control window for the given stream that is currently available for sending/receiving frames which are subject to flow control.
-
-
-
Method Detail
-
channelHandlerContext
void channelHandlerContext(ChannelHandlerContext ctx) throws Http2Exception
Set theChannelHandlerContextfor which to apply flow control on.This must be called to properly initialize the
Http2FlowController. Not calling this is considered a programming error.- Parameters:
ctx- TheChannelHandlerContextfor which to apply flow control on.- Throws:
Http2Exception- if any protocol-related error occurred.
-
initialWindowSize
void initialWindowSize(int newWindowSize) throws Http2ExceptionSets the connection-wide initial flow control window and updates all stream windows (but not the connection stream window) by the delta.Represents the value for SETTINGS_INITIAL_WINDOW_SIZE. This method should only be called by Netty (not users) as a result of a receiving a
SETTINGSframe.- Parameters:
newWindowSize- the new initial window size.- Throws:
Http2Exception- thrown if any protocol-related error occurred.
-
initialWindowSize
int initialWindowSize()
Gets the connection-wide initial flow control window size that is used as the basis for new stream flow control windows.Represents the value for SETTINGS_INITIAL_WINDOW_SIZE. The initial value returned by this method must be
Http2CodecUtil.DEFAULT_WINDOW_SIZE.
-
windowSize
int windowSize(Http2Stream stream)
Get the portion of the flow control window for the given stream that is currently available for sending/receiving frames which are subject to flow control. This quantity is measured in number of bytes.
-
incrementWindowSize
void incrementWindowSize(Http2Stream stream, int delta) throws Http2Exception
Increments the size of the stream's flow control window by the given delta.In the case of a
Http2RemoteFlowControllerthis is called upon receipt of aWINDOW_UPDATEframe from the remote endpoint to mirror the changes to the window size.For a
Http2LocalFlowControllerthis can be called to request the expansion of the window size published by this endpoint. It is up to the implementation, however, as to when aWINDOW_UPDATEis actually sent.- Parameters:
stream- The subject stream. UseHttp2Connection.connectionStream()for requesting the size of the connection window.delta- the change in size of the flow control window.- Throws:
Http2Exception- thrown if a protocol-related error occurred.
-
-