Package io.netty.handler.codec.spdy
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 class
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelFutureListener
private static final int
private static final int
private int
private int
private int
private int
private int
private final int
private final AtomicInteger
private static final SpdyProtocolException
private boolean
private int
private boolean
private final boolean
private final SpdySession
private static final SpdyProtocolException
-
Constructor Summary
ConstructorsConstructorDescriptionSpdySessionHandler
(SpdyVersion version, boolean server) Creates a new session handler. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
acceptStream
(int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) void
CallsChannelHandlerContext.fireChannelInactive()
to forward to the nextChannelInboundHandler
in theChannelPipeline
.void
channelRead
(ChannelHandlerContext ctx, Object msg) CallsChannelHandlerContext.fireChannelRead(Object)
to forward to the nextChannelInboundHandler
in theChannelPipeline
.void
close
(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.close(ChannelPromise)
to forward to the nextChannelOutboundHandler
in theChannelPipeline
.void
exceptionCaught
(ChannelHandlerContext ctx, Throwable cause) CallsChannelHandlerContext.fireExceptionCaught(Throwable)
to forward to the nextChannelHandler
in theChannelPipeline
.private void
halfCloseStream
(int streamId, boolean remote, ChannelFuture future) private void
handleOutboundMessage
(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) private boolean
isRemoteInitiatedId
(int id) private void
issueSessionError
(ChannelHandlerContext ctx, SpdySessionStatus status) private void
issueStreamError
(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status) private void
removeStream
(int streamId, ChannelFuture future) private void
sendGoAwayFrame
(ChannelHandlerContext ctx, ChannelPromise future) private ChannelFuture
sendGoAwayFrame
(ChannelHandlerContext ctx, SpdySessionStatus status) void
setSessionReceiveWindowSize
(int sessionReceiveWindowSize) private void
updateInitialReceiveWindowSize
(int newInitialWindowSize) private void
updateInitialSendWindowSize
(int newInitialWindowSize) private void
updateSendWindowSize
(ChannelHandlerContext ctx, int streamId, int deltaWindowSize) void
write
(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) CallsChannelOutboundInvoker.write(Object, ChannelPromise)
to forward to the nextChannelOutboundHandler
in theChannelPipeline
.Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.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
-true
if and only if this session handler should handle the server endpoint of the connection.false
if 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:ChannelInboundHandlerAdapter
CallsChannelHandlerContext.fireChannelRead(Object)
to forward to the nextChannelInboundHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
channelRead
in interfaceChannelInboundHandler
- Overrides:
channelRead
in classChannelInboundHandlerAdapter
- Throws:
Exception
-
channelInactive
Description copied from class:ChannelInboundHandlerAdapter
CallsChannelHandlerContext.fireChannelInactive()
to forward to the nextChannelInboundHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
channelInactive
in interfaceChannelInboundHandler
- Overrides:
channelInactive
in classChannelInboundHandlerAdapter
- Throws:
Exception
-
exceptionCaught
Description copied from class:ChannelInboundHandlerAdapter
CallsChannelHandlerContext.fireExceptionCaught(Throwable)
to forward to the nextChannelHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
exceptionCaught
in interfaceChannelHandler
- Specified by:
exceptionCaught
in interfaceChannelInboundHandler
- Overrides:
exceptionCaught
in classChannelInboundHandlerAdapter
- Throws:
Exception
-
close
Description copied from class:ChannelDuplexHandler
CallsChannelOutboundInvoker.close(ChannelPromise)
to forward to the nextChannelOutboundHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
close
in interfaceChannelOutboundHandler
- Overrides:
close
in classChannelDuplexHandler
- Parameters:
ctx
- theChannelHandlerContext
for which the close operation is madepromise
- theChannelPromise
to notify once the operation completes- Throws:
Exception
- thrown if an error occurs
-
write
Description copied from class:ChannelDuplexHandler
CallsChannelOutboundInvoker.write(Object, ChannelPromise)
to forward to the nextChannelOutboundHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
write
in interfaceChannelOutboundHandler
- Overrides:
write
in classChannelDuplexHandler
- Parameters:
ctx
- theChannelHandlerContext
for which the write operation is mademsg
- the message to writepromise
- theChannelPromise
to 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
-