public interface Http2LocalFlowController extends Http2FlowController
Http2FlowController
for controlling the inbound flow of DATA
frames from the remote endpoint.Modifier and Type | Method and Description |
---|---|
boolean |
consumeBytes(Http2Stream stream,
int numBytes)
Indicates that the application has consumed a number of bytes for the given stream and is therefore ready to
receive more data from the remote endpoint.
|
Http2LocalFlowController |
frameWriter(Http2FrameWriter frameWriter)
Sets the writer to be use for sending
WINDOW_UPDATE frames. |
int |
initialWindowSize(Http2Stream stream)
Get the initial flow control window size for the given stream.
|
void |
receiveFlowControlledFrame(Http2Stream stream,
ByteBuf data,
int padding,
boolean endOfStream)
Receives an inbound
DATA frame from the remote endpoint and applies flow control policies to it for both
the stream as well as the connection. |
int |
unconsumedBytes(Http2Stream stream)
The number of bytes for the given stream that have been received but not yet consumed by the
application.
|
channelHandlerContext, incrementWindowSize, initialWindowSize, initialWindowSize, windowSize
Http2LocalFlowController frameWriter(Http2FrameWriter frameWriter)
WINDOW_UPDATE
frames. This must be called before any flow
controlled data is received.frameWriter
- the HTTP/2 frame writer.void receiveFlowControlledFrame(Http2Stream stream, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception
DATA
frame from the remote endpoint and applies flow control policies to it for both
the stream
as well as the connection. If any flow control policies have been violated, an exception is
raised immediately, otherwise the frame is considered to have "passed" flow control.
If stream
is null
or closed, flow control should only be applied to the connection window and the
bytes are immediately consumed.stream
- the subject stream for the received frame. The connection stream object must not be used. If stream
is null
or closed, flow control should only be applied to the connection window and the bytes are
immediately consumed.data
- payload buffer for the frame.padding
- additional bytes that should be added to obscure the true content size. Must be between 0 and
256 (inclusive).endOfStream
- Indicates whether this is the last frame to be sent from the remote endpoint for this stream.Http2Exception
- if any flow control errors are encountered.boolean consumeBytes(Http2Stream stream, int numBytes) throws Http2Exception
WINDOW_UPDATE
to
restore a portion of the flow control window for the stream.
If stream
is null
or closed (i.e. Http2Stream.state()
method returns Http2Stream.State.CLOSED
), calling this method has no effect.stream
- the stream for which window space should be freed. The connection stream object must not be used.
If stream
is null
or closed (i.e. Http2Stream.state()
method returns Http2Stream.State.CLOSED
), calling this method has no effect.numBytes
- the number of bytes to be returned to the flow control window.WINDOW_UPDATE
was sent, false otherwise.Http2Exception
- if the number of bytes returned exceeds the unconsumedBytes(Http2Stream)
for the
stream.int unconsumedBytes(Http2Stream stream)
stream
- the stream for which window space should be freed.int initialWindowSize(Http2Stream stream)
Http2FlowController.initialWindowSize()
- Http2FlowController.windowSize(Http2Stream)
.Copyright © 2008–2024 The Netty Project. All rights reserved.