Package io.netty.handler.codec.http2
Class DefaultHttp2RemoteFlowController.ListenerWritabilityMonitor
java.lang.Object
io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController.WritabilityMonitor
io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController.ListenerWritabilityMonitor
- All Implemented Interfaces:
Http2StreamVisitor
,StreamByteDistributor.Writer
- Enclosing class:
DefaultHttp2RemoteFlowController
private final class DefaultHttp2RemoteFlowController.ListenerWritabilityMonitor
extends DefaultHttp2RemoteFlowController.WritabilityMonitor
implements Http2StreamVisitor
Writability of a
stream
is calculated using the following:
Connection Window - Total Queued Bytes > 0 invalid input: '&'invalid input: '&' Stream Window - Bytes Queued for Stream > 0 invalid input: '&'invalid input: '&' isChannelWritable()
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Called when the writability of the underlying channel changes.private void
private void
private void
(package private) void
enqueueFrame
(DefaultHttp2RemoteFlowController.FlowState state, Http2RemoteFlowController.FlowControlled frame) Add a frame to be sent via flow control.(package private) void
incrementWindowSize
(DefaultHttp2RemoteFlowController.FlowState state, int delta) Increment the window size for a particular stream.(package private) void
initialWindowSize
(int newWindowSize) private void
(package private) void
Called when the state is cancelled.boolean
visit
(Http2Stream stream) (package private) void
windowSize
(DefaultHttp2RemoteFlowController.FlowState state, int initialWindowSize) Set the initial window size forstate
.Methods inherited from class io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController.WritabilityMonitor
incrementPendingBytes, isWritable, isWritableConnection, write, writePendingBytes
-
Field Details
-
listener
-
-
Constructor Details
-
ListenerWritabilityMonitor
ListenerWritabilityMonitor(Http2RemoteFlowController.Listener listener)
-
-
Method Details
-
visit
- Specified by:
visit
in interfaceHttp2StreamVisitor
- Returns:
true
if the visitor wants to continue the loop and handle the entry.false
if the visitor wants to stop handling headers and abort the loop.
- Throws:
Http2Exception
-
windowSize
Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitor
Set the initial window size forstate
.- Overrides:
windowSize
in classDefaultHttp2RemoteFlowController.WritabilityMonitor
- Parameters:
state
- the state to change the initial window size for.initialWindowSize
- the size of the window in bytes.
-
incrementWindowSize
void incrementWindowSize(DefaultHttp2RemoteFlowController.FlowState state, int delta) throws Http2Exception Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitor
Increment the window size for a particular stream.- Overrides:
incrementWindowSize
in classDefaultHttp2RemoteFlowController.WritabilityMonitor
- Parameters:
state
- the state associated with the stream whose window is being incremented.delta
- The amount to increment by.- Throws:
Http2Exception
- If this operation overflows the window forstate
.
-
initialWindowSize
- Overrides:
initialWindowSize
in classDefaultHttp2RemoteFlowController.WritabilityMonitor
- Throws:
Http2Exception
-
enqueueFrame
void enqueueFrame(DefaultHttp2RemoteFlowController.FlowState state, Http2RemoteFlowController.FlowControlled frame) throws Http2Exception Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitor
Add a frame to be sent via flow control.- Overrides:
enqueueFrame
in classDefaultHttp2RemoteFlowController.WritabilityMonitor
- Parameters:
state
- The state associated with the stream which theframe
is associated with.frame
- the frame to enqueue.- Throws:
Http2Exception
- If a writability error occurs.
-
stateCancelled
Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitor
Called when the state is cancelled.- Overrides:
stateCancelled
in classDefaultHttp2RemoteFlowController.WritabilityMonitor
- Parameters:
state
- the state that was cancelled.
-
channelWritabilityChange
Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitor
Called when the writability of the underlying channel changes.- Overrides:
channelWritabilityChange
in classDefaultHttp2RemoteFlowController.WritabilityMonitor
- Throws:
Http2Exception
- If a write occurs and an exception happens in the write operation.
-
checkStateWritability
private void checkStateWritability(DefaultHttp2RemoteFlowController.FlowState state) throws Http2Exception - Throws:
Http2Exception
-
notifyWritabilityChanged
-
checkConnectionThenStreamWritabilityChanged
private void checkConnectionThenStreamWritabilityChanged(DefaultHttp2RemoteFlowController.FlowState state) throws Http2Exception - Throws:
Http2Exception
-
checkAllWritabilityChanged
- Throws:
Http2Exception
-