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) voidCalled when the writability of the underlying channel changes.private voidprivate voidprivate void(package private) voidenqueueFrame(DefaultHttp2RemoteFlowController.FlowState state, Http2RemoteFlowController.FlowControlled frame) Add a frame to be sent via flow control.(package private) voidincrementWindowSize(DefaultHttp2RemoteFlowController.FlowState state, int delta) Increment the window size for a particular stream.(package private) voidinitialWindowSize(int newWindowSize) private void(package private) voidCalled when the state is cancelled.booleanvisit(Http2Stream stream) (package private) voidwindowSize(DefaultHttp2RemoteFlowController.FlowState state, int initialWindowSize) Set the initial window size forstate.Methods inherited from class DefaultHttp2RemoteFlowController.WritabilityMonitor
incrementPendingBytes, isWritable, isWritableConnection, write, writePendingBytes
-
Field Details
-
listener
-
-
Constructor Details
-
ListenerWritabilityMonitor
ListenerWritabilityMonitor(Http2RemoteFlowController.Listener listener)
-
-
Method Details
-
visit
- Specified by:
visitin interfaceHttp2StreamVisitor- Returns:
trueif the visitor wants to continue the loop and handle the entry.falseif the visitor wants to stop handling headers and abort the loop.
- Throws:
Http2Exception
-
windowSize
Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitorSet the initial window size forstate.- Overrides:
windowSizein 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.WritabilityMonitorIncrement the window size for a particular stream.- Overrides:
incrementWindowSizein 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:
initialWindowSizein classDefaultHttp2RemoteFlowController.WritabilityMonitor- Throws:
Http2Exception
-
enqueueFrame
void enqueueFrame(DefaultHttp2RemoteFlowController.FlowState state, Http2RemoteFlowController.FlowControlled frame) throws Http2Exception Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitorAdd a frame to be sent via flow control.- Overrides:
enqueueFramein classDefaultHttp2RemoteFlowController.WritabilityMonitor- Parameters:
state- The state associated with the stream which theframeis associated with.frame- the frame to enqueue.- Throws:
Http2Exception- If a writability error occurs.
-
stateCancelled
Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitorCalled when the state is cancelled.- Overrides:
stateCancelledin classDefaultHttp2RemoteFlowController.WritabilityMonitor- Parameters:
state- the state that was cancelled.
-
channelWritabilityChange
Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitorCalled when the writability of the underlying channel changes.- Overrides:
channelWritabilityChangein 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
-