public class SpdySessionHandler extends ChannelDuplexHandler
| Modifier and Type | Class and Description |
|---|---|
private static class |
SpdySessionHandler.ClosingChannelFutureListener |
ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private ChannelFutureListener |
closeSessionFutureListener |
private static int |
DEFAULT_MAX_CONCURRENT_STREAMS |
private static int |
DEFAULT_WINDOW_SIZE |
private int |
initialReceiveWindowSize |
private int |
initialSendWindowSize |
private int |
initialSessionReceiveWindowSize |
private int |
lastGoodStreamId |
private int |
localConcurrentStreams |
private int |
minorVersion |
private java.util.concurrent.atomic.AtomicInteger |
pings |
private static SpdyProtocolException |
PROTOCOL_EXCEPTION |
private boolean |
receivedGoAwayFrame |
private int |
remoteConcurrentStreams |
private boolean |
sentGoAwayFrame |
private boolean |
server |
private SpdySession |
spdySession |
private static SpdyProtocolException |
STREAM_CLOSED |
| Constructor and Description |
|---|
SpdySessionHandler(SpdyVersion version,
boolean server)
Creates a new session handler.
|
bind, connect, deregister, disconnect, flush, readchannelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAdded, handlerRemovedprivate static final SpdyProtocolException PROTOCOL_EXCEPTION
private static final SpdyProtocolException STREAM_CLOSED
private static final int DEFAULT_WINDOW_SIZE
private int initialSendWindowSize
private int initialReceiveWindowSize
private volatile int initialSessionReceiveWindowSize
private final SpdySession spdySession
private int lastGoodStreamId
private static final int DEFAULT_MAX_CONCURRENT_STREAMS
private int remoteConcurrentStreams
private int localConcurrentStreams
private final java.util.concurrent.atomic.AtomicInteger pings
private boolean sentGoAwayFrame
private boolean receivedGoAwayFrame
private ChannelFutureListener closeSessionFutureListener
private final boolean server
private final int minorVersion
public SpdySessionHandler(SpdyVersion version, boolean server)
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.public void setSessionReceiveWindowSize(int sessionReceiveWindowSize)
public void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelRead in interface ChannelInboundHandlerchannelRead in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelInactive() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelInactive in interface ChannelInboundHandlerchannelInactive in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireExceptionCaught(Throwable) to forward
to the next ChannelHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.exceptionCaught in interface ChannelHandlerexceptionCaught in interface ChannelInboundHandlerexceptionCaught in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelDuplexHandlerChannelOutboundInvoker.close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.close in interface ChannelOutboundHandlerclose in class ChannelDuplexHandlerctx - the ChannelHandlerContext for which the close operation is madepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelDuplexHandlerChannelOutboundInvoker.write(Object, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.write in interface ChannelOutboundHandlerwrite in class ChannelDuplexHandlerctx - the ChannelHandlerContext for which the write operation is mademsg - the message to writepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occursprivate void handleOutboundMessage(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
java.lang.Exceptionprivate void issueSessionError(ChannelHandlerContext ctx, SpdySessionStatus status)
private void issueStreamError(ChannelHandlerContext ctx, int streamId, SpdyStreamStatus status)
private boolean isRemoteInitiatedId(int id)
private void updateInitialSendWindowSize(int newInitialWindowSize)
private void updateInitialReceiveWindowSize(int newInitialWindowSize)
private boolean acceptStream(int streamId,
byte priority,
boolean remoteSideClosed,
boolean localSideClosed)
private void halfCloseStream(int streamId,
boolean remote,
ChannelFuture future)
private void removeStream(int streamId,
ChannelFuture future)
private void updateSendWindowSize(ChannelHandlerContext ctx, int streamId, int deltaWindowSize)
private void sendGoAwayFrame(ChannelHandlerContext ctx, ChannelPromise future)
private ChannelFuture sendGoAwayFrame(ChannelHandlerContext ctx, SpdySessionStatus status)