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 astreamis calculated using the following:Connection Window - Total Queued Bytes > 0 && Stream Window - Bytes Queued for Stream > 0 && isChannelWritable()
-
-
Field Summary
Fields Modifier and Type Field Description private Http2RemoteFlowController.Listenerlistener
-
Constructor Summary
Constructors Constructor Description ListenerWritabilityMonitor(Http2RemoteFlowController.Listener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidchannelWritabilityChange()Called when the writability of the underlying channel changes.private voidcheckAllWritabilityChanged()private voidcheckConnectionThenStreamWritabilityChanged(DefaultHttp2RemoteFlowController.FlowState state)private voidcheckStateWritability(DefaultHttp2RemoteFlowController.FlowState state)(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 voidnotifyWritabilityChanged(DefaultHttp2RemoteFlowController.FlowState state)(package private) voidstateCancelled(DefaultHttp2RemoteFlowController.FlowState state)Called 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 io.netty.handler.codec.http2.DefaultHttp2RemoteFlowController.WritabilityMonitor
incrementPendingBytes, isWritable, isWritableConnection, write, writePendingBytes
-
-
-
-
Field Detail
-
listener
private final Http2RemoteFlowController.Listener listener
-
-
Constructor Detail
-
ListenerWritabilityMonitor
ListenerWritabilityMonitor(Http2RemoteFlowController.Listener listener)
-
-
Method Detail
-
visit
public boolean visit(Http2Stream stream) throws Http2Exception
- 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
void windowSize(DefaultHttp2RemoteFlowController.FlowState state, int initialWindowSize)
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
void initialWindowSize(int newWindowSize) throws Http2Exception- 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
void stateCancelled(DefaultHttp2RemoteFlowController.FlowState state)
Description copied from class:DefaultHttp2RemoteFlowController.WritabilityMonitorCalled when the state is cancelled.- Overrides:
stateCancelledin classDefaultHttp2RemoteFlowController.WritabilityMonitor- Parameters:
state- the state that was cancelled.
-
channelWritabilityChange
void channelWritabilityChange() throws Http2ExceptionDescription 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
private void notifyWritabilityChanged(DefaultHttp2RemoteFlowController.FlowState state)
-
checkConnectionThenStreamWritabilityChanged
private void checkConnectionThenStreamWritabilityChanged(DefaultHttp2RemoteFlowController.FlowState state) throws Http2Exception
- Throws:
Http2Exception
-
checkAllWritabilityChanged
private void checkAllWritabilityChanged() throws Http2Exception- Throws:
Http2Exception
-
-