- All Known Subinterfaces:
WindowSize.Inbound
,WindowSize.Outbound
public interface WindowSize
Window size container, used with
FlowControl
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Inbound window size container.static interface
Outbound window size container. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default and smallest possible setting for MAX_FRAME_SIZE (2^14).static final int
Default window size.static final int
Largest possible setting for MAX_FRAME_SIZE (2^24-1).static final int
Maximal window size. -
Method Summary
Modifier and TypeMethodDescriptionstatic WindowSize.Inbound
createInbound
(io.helidon.http.http2.ConnectionFlowControl.Type type, int streamId, int initialWindowSize, int maxFrameSize, BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create inbound window size container with initial window size set.static WindowSize.Inbound
createInboundNoop
(int streamId, BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create inbound window size container with flow control turned off.static WindowSize.Outbound
createOutbound
(io.helidon.http.http2.ConnectionFlowControl.Type type, int streamId, ConnectionFlowControl connectionFlowControl) Create outbound window size container with initial window size set.int
decrementWindowSize
(int decrement) Decrement window size.int
Remaining window size.long
incrementWindowSize
(int increment) Increment window size.void
resetWindowSize
(int size) Reset window size.
-
Field Details
-
DEFAULT_WIN_SIZE
static final int DEFAULT_WIN_SIZEDefault window size.- See Also:
-
DEFAULT_MAX_FRAME_SIZE
static final int DEFAULT_MAX_FRAME_SIZEDefault and smallest possible setting for MAX_FRAME_SIZE (2^14).- See Also:
-
MAX_MAX_FRAME_SIZE
static final int MAX_MAX_FRAME_SIZELargest possible setting for MAX_FRAME_SIZE (2^24-1).- See Also:
-
MAX_WIN_SIZE
static final int MAX_WIN_SIZEMaximal window size.- See Also:
-
-
Method Details
-
createInbound
static WindowSize.Inbound createInbound(io.helidon.http.http2.ConnectionFlowControl.Type type, int streamId, int initialWindowSize, int maxFrameSize, BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create inbound window size container with initial window size set.- Parameters:
type
-streamId
-initialWindowSize
- initial window sizemaxFrameSize
- maximal frame sizewindowUpdateWriter
- writer method for HTTP/2 WINDOW_UPDATE frame- Returns:
- a new window size container
-
createOutbound
static WindowSize.Outbound createOutbound(io.helidon.http.http2.ConnectionFlowControl.Type type, int streamId, ConnectionFlowControl connectionFlowControl) Create outbound window size container with initial window size set.- Parameters:
type
- Server or clientstreamId
- stream idconnectionFlowControl
- connection flow control- Returns:
- a new window size container
-
createInboundNoop
static WindowSize.Inbound createInboundNoop(int streamId, BiConsumer<Integer, Http2WindowUpdate> windowUpdateWriter) Create inbound window size container with flow control turned off.- Parameters:
streamId
- stream id or 0 for connectionwindowUpdateWriter
- WINDOW_UPDATE frame writer- Returns:
- a new window size container
-
resetWindowSize
void resetWindowSize(int size) Reset window size.- Parameters:
size
- new window size
-
incrementWindowSize
long incrementWindowSize(int increment) Increment window size.- Parameters:
increment
- increment- Returns:
- whether the increment succeeded
-
decrementWindowSize
int decrementWindowSize(int decrement) Decrement window size.- Parameters:
decrement
- decrement- Returns:
- remaining size
-
getRemainingWindowSize
int getRemainingWindowSize()Remaining window size.- Returns:
- remaining size
-