java.lang.Object
io.helidon.http.http2.ConnectionFlowControl
HTTP/2 Flow control for connection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConnection flow control builder. -
Method Summary
Modifier and TypeMethodDescriptionclientBuilder(BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create connection HTTP/2 flow-control for client side.createStreamFlowControl(int streamId, int outboundInitialWindowSize, int outboundMaxFrameSize) Create stream specific inbound and outbound flow control.longdecrementInboundConnectionWindowSize(int decrement) Decrement inbound connection flow control window, called when DATA frame is received.longincrementOutboundConnectionWindowSize(int increment) Increment outbound connection flow control window, called when WINDOW_UPDATE is received.outbound()Connection outbound flow control window, decrements when DATA are sent and increments when WINDOW_UPDATE or INIT_WINDOW_SIZE is received.voidresetInitialWindowSize(int initialWindowSize) Reset an initial window size value for outbound flow control windows of a new streams.voidresetMaxFrameSize(int maxFrameSize) Reset MAX_FRAME_SIZE for all streams, existing and future ones.serverBuilder(BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create connection HTTP/2 flow-control for server side.
-
Method Details
-
serverBuilder
public static ConnectionFlowControl.ConnectionFlowControlBuilder serverBuilder(BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create connection HTTP/2 flow-control for server side.- Parameters:
windowUpdateWriter- method called for sending WINDOW_UPDATE frames to the client.- Returns:
- Connection HTTP/2 flow-control
-
clientBuilder
public static ConnectionFlowControl.ConnectionFlowControlBuilder clientBuilder(BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create connection HTTP/2 flow-control for client side.- Parameters:
windowUpdateWriter- method called for sending WINDOW_UPDATE frames to the server.- Returns:
- Connection HTTP/2 flow-control
-
createStreamFlowControl
public StreamFlowControl createStreamFlowControl(int streamId, int outboundInitialWindowSize, int outboundMaxFrameSize) Create stream specific inbound and outbound flow control.- Parameters:
streamId- stream idoutboundInitialWindowSize- initial window size for inbound flow control.outboundMaxFrameSize- max frame size for inbound flow control.- Returns:
- stream flow control
-
incrementOutboundConnectionWindowSize
public long incrementOutboundConnectionWindowSize(int increment) Increment outbound connection flow control window, called when WINDOW_UPDATE is received.- Parameters:
increment- number of bytes other side has requested on top of actual demand- Returns:
- outbound window size after increment
-
decrementInboundConnectionWindowSize
public long decrementInboundConnectionWindowSize(int decrement) Decrement inbound connection flow control window, called when DATA frame is received.- Parameters:
decrement- received DATA frame size in bytes- Returns:
- inbound window size after decrement
-
resetMaxFrameSize
public void resetMaxFrameSize(int maxFrameSize) Reset MAX_FRAME_SIZE for all streams, existing and future ones.- Parameters:
maxFrameSize- to split data frames according to when larger
-
resetInitialWindowSize
public void resetInitialWindowSize(int initialWindowSize) Reset an initial window size value for outbound flow control windows of a new streams. Don't forget to call stream.flowControl().outbound().resetStreamWindowSize(...) for each stream to align window size of existing streams.- Parameters:
initialWindowSize- INIT_WINDOW_SIZE received
-
outbound
Connection outbound flow control window, decrements when DATA are sent and increments when WINDOW_UPDATE or INIT_WINDOW_SIZE is received. Blocks sending when window is depleted.- Returns:
- connection outbound flow control window
-