Class SpdySessionHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.spdy.SpdySessionHandler
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler, ChannelOutboundHandler
Manages streams within a SPDY session.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classNested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelFutureListenerprivate static final intprivate static final intprivate intprivate intprivate intprivate intprivate intprivate final intprivate final AtomicIntegerprivate static final SpdyProtocolExceptionprivate booleanprivate intprivate booleanprivate final booleanprivate final SpdySessionprivate static final SpdyProtocolException -
Constructor Summary
ConstructorsConstructorDescriptionSpdySessionHandler(SpdyVersion version, boolean server) Creates a new session handler. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanacceptStream(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) voidCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidchannelRead(ChannelHandlerContext ctx, Object msg) CallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.voidclose(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.close(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) CallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline.private voidhalfCloseStream(int streamId, boolean remote, ChannelFuture future) private voidhandleOutboundMessage(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) private booleanisRemoteInitiatedId(int id) private voidissueSessionError(ChannelHandlerContext ctx, SpdySessionStatus status) private voidissueStreamError(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status) private voidremoveStream(int streamId, ChannelFuture future) private voidsendGoAwayFrame(ChannelHandlerContext ctx, ChannelPromise future) private ChannelFuturesendGoAwayFrame(ChannelHandlerContext ctx, SpdySessionStatus status) voidsetSessionReceiveWindowSize(int sessionReceiveWindowSize) private voidupdateInitialReceiveWindowSize(int newInitialWindowSize) private voidupdateInitialSendWindowSize(int newInitialWindowSize) private voidupdateSendWindowSize(ChannelHandlerContext ctx, int streamId, int deltaWindowSize) voidwrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) CallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.Methods inherited from class ChannelDuplexHandler
bind, connect, deregister, disconnect, flush, readMethods inherited from class ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
PROTOCOL_EXCEPTION
-
STREAM_CLOSED
-
DEFAULT_WINDOW_SIZE
private static final int DEFAULT_WINDOW_SIZE- See Also:
-
initialSendWindowSize
private int initialSendWindowSize -
initialReceiveWindowSize
private int initialReceiveWindowSize -
initialSessionReceiveWindowSize
private volatile int initialSessionReceiveWindowSize -
spdySession
-
lastGoodStreamId
private int lastGoodStreamId -
DEFAULT_MAX_CONCURRENT_STREAMS
private static final int DEFAULT_MAX_CONCURRENT_STREAMS- See Also:
-
remoteConcurrentStreams
private int remoteConcurrentStreams -
localConcurrentStreams
private int localConcurrentStreams -
pings
-
sentGoAwayFrame
private boolean sentGoAwayFrame -
receivedGoAwayFrame
private boolean receivedGoAwayFrame -
closeSessionFutureListener
-
server
private final boolean server -
minorVersion
private final int minorVersion
-
-
Constructor Details
-
SpdySessionHandler
Creates a new session handler.- Parameters:
version- the protocol versionserver-trueif and only if this session handler should handle the server endpoint of the connection.falseif and only if this session handler should handle the client endpoint of the connection.
-
-
Method Details
-
setSessionReceiveWindowSize
public void setSessionReceiveWindowSize(int sessionReceiveWindowSize) -
channelRead
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelReadin interfaceChannelInboundHandler- Overrides:
channelReadin classChannelInboundHandlerAdapter- Throws:
Exception
-
channelInactive
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelInactivein interfaceChannelInboundHandler- Overrides:
channelInactivein classChannelInboundHandlerAdapter- Throws:
Exception
-
exceptionCaught
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
exceptionCaughtin interfaceChannelHandler- Specified by:
exceptionCaughtin interfaceChannelInboundHandler- Overrides:
exceptionCaughtin classChannelInboundHandlerAdapter- Throws:
Exception
-
close
Description copied from class:ChannelDuplexHandlerCallsChannelOutboundInvoker.close(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
closein interfaceChannelOutboundHandler- Overrides:
closein classChannelDuplexHandler- Parameters:
ctx- theChannelHandlerContextfor which the close operation is madepromise- theChannelPromiseto notify once the operation completes- Throws:
Exception- thrown if an error occurs
-
write
Description copied from class:ChannelDuplexHandlerCallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
writein interfaceChannelOutboundHandler- Overrides:
writein classChannelDuplexHandler- Parameters:
ctx- theChannelHandlerContextfor which the write operation is mademsg- the message to writepromise- theChannelPromiseto notify once the operation completes- Throws:
Exception- thrown if an error occurs
-
handleOutboundMessage
private void handleOutboundMessage(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception - Throws:
Exception
-
issueSessionError
-
issueStreamError
-
isRemoteInitiatedId
private boolean isRemoteInitiatedId(int id) -
updateInitialSendWindowSize
private void updateInitialSendWindowSize(int newInitialWindowSize) -
updateInitialReceiveWindowSize
private void updateInitialReceiveWindowSize(int newInitialWindowSize) -
acceptStream
private boolean acceptStream(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) -
halfCloseStream
-
removeStream
-
updateSendWindowSize
-
sendGoAwayFrame
-
sendGoAwayFrame
-