public class DefaultHttp2RemoteFlowController extends Object implements Http2RemoteFlowController
Http2RemoteFlowController.Http2RemoteFlowController.FlowControlled| Constructor and Description |
|---|
DefaultHttp2RemoteFlowController(Http2Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
incrementWindowSize(ChannelHandlerContext ctx,
Http2Stream stream,
int delta)
Increments the size of the stream's flow control window by the given delta.
|
int |
initialWindowSize()
Gets the initial flow control window size that is used as the basis for new stream flow
control windows.
|
void |
initialWindowSize(int newWindowSize)
Sets the initial flow control window and updates all stream windows (but not the connection
window) by the delta.
|
void |
sendFlowControlled(ChannelHandlerContext ctx,
Http2Stream stream,
Http2RemoteFlowController.FlowControlled payload)
Writes or queues a payload for transmission to the remote endpoint.
|
int |
windowSize(Http2Stream stream)
Gets the number of bytes remaining in the flow control window size for the given stream.
|
public DefaultHttp2RemoteFlowController(Http2Connection connection)
public void initialWindowSize(int newWindowSize)
throws Http2Exception
Http2FlowController
This method is used to apply the SETTINGS_INITIAL_WINDOW_SIZE value for an
SETTINGS frame.
initialWindowSize in interface Http2FlowControllernewWindowSize - the new initial window size.Http2Exception - thrown if any protocol-related error occurred.public int initialWindowSize()
Http2FlowControllerinitialWindowSize in interface Http2FlowControllerpublic int windowSize(Http2Stream stream)
Http2FlowControllerwindowSize in interface Http2FlowControllerstream - The subject stream. Use Http2Connection.connectionStream() for
requesting the size of the connection window.public void incrementWindowSize(ChannelHandlerContext ctx, Http2Stream stream, int delta) throws Http2Exception
Http2FlowController
In the case of a Http2RemoteFlowController this is called upon receipt of a
WINDOW_UPDATE frame from the remote endpoint to mirror the changes to the window
size.
For a Http2LocalFlowController this 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 a
WINDOW_UPDATE is actually sent.
incrementWindowSize in interface Http2FlowControllerctx - The context for the calling handlerstream - The subject stream. Use Http2Connection.connectionStream() for
requesting the size of the connection window.delta - the change in size of the flow control window.Http2Exception - thrown if a protocol-related error occurred.public void sendFlowControlled(ChannelHandlerContext ctx, Http2Stream stream, Http2RemoteFlowController.FlowControlled payload)
Http2RemoteFlowController
Manually flushing the ChannelHandlerContext is not required, since the flow
controller will flush as appropriate.
sendFlowControlled in interface Http2RemoteFlowControllerctx - the context from the handler.stream - the subject stream. Must not be the connection stream object.payload - payload to write subject to flow-control accounting and ordering rules.Copyright © 2008–2015 The Netty Project. All rights reserved.