public class SpdySessionHandler extends SimpleChannelUpstreamHandler implements ChannelDownstreamHandler
| 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 java.lang.Object |
flowControlLock |
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 |
| Constructor and Description |
|---|
SpdySessionHandler(SpdyVersion spdyVersion,
boolean server)
Creates a new session handler.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
acceptStream(int streamId,
byte priority,
boolean remoteSideClosed,
boolean localSideClosed) |
void |
exceptionCaught(ChannelHandlerContext ctx,
ExceptionEvent e)
Invoked when an exception was raised by an I/O thread or a
ChannelHandler. |
private void |
halfCloseStream(int streamId,
boolean remote,
ChannelFuture future) |
void |
handleDownstream(ChannelHandlerContext ctx,
ChannelEvent evt)
Handles the specified downstream event.
|
private boolean |
isRemoteInitiatedId(int id) |
private void |
issueSessionError(ChannelHandlerContext ctx,
Channel channel,
java.net.SocketAddress remoteAddress,
SpdySessionStatus status) |
private void |
issueStreamError(ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
int streamId,
SpdyStreamStatus status) |
void |
messageReceived(ChannelHandlerContext ctx,
MessageEvent e)
Invoked when a message object (e.g:
ChannelBuffer) was received
from a remote peer. |
private void |
removeStream(int streamId,
ChannelFuture future) |
private ChannelFuture |
sendGoAwayFrame(ChannelHandlerContext ctx,
Channel channel,
java.net.SocketAddress remoteAddress,
SpdySessionStatus status) |
private void |
sendGoAwayFrame(ChannelHandlerContext ctx,
ChannelStateEvent e) |
void |
setSessionReceiveWindowSize(int sessionReceiveWindowSize) |
private void |
updateInitialReceiveWindowSize(int newInitialWindowSize) |
private void |
updateInitialSendWindowSize(int newInitialWindowSize) |
private void |
updateSendWindowSize(ChannelHandlerContext ctx,
int streamId,
int deltaWindowSize) |
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeCompleteprivate static final SpdyProtocolException PROTOCOL_EXCEPTION
private static final int DEFAULT_WINDOW_SIZE
private volatile int initialSendWindowSize
private volatile int initialReceiveWindowSize
private volatile int initialSessionReceiveWindowSize
private final SpdySession spdySession
private volatile int lastGoodStreamId
private static final int DEFAULT_MAX_CONCURRENT_STREAMS
private volatile int remoteConcurrentStreams
private volatile int localConcurrentStreams
private final java.lang.Object flowControlLock
private final java.util.concurrent.atomic.AtomicInteger pings
private volatile boolean sentGoAwayFrame
private volatile boolean receivedGoAwayFrame
private volatile ChannelFutureListener closeSessionFutureListener
private final boolean server
private final int minorVersion
public SpdySessionHandler(SpdyVersion spdyVersion, boolean server)
spdyVersion - 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 messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws java.lang.Exception
SimpleChannelUpstreamHandlerChannelBuffer) was received
from a remote peer.messageReceived in class SimpleChannelUpstreamHandlerjava.lang.Exceptionpublic void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws java.lang.Exception
SimpleChannelUpstreamHandlerChannelHandler.exceptionCaught in class SimpleChannelUpstreamHandlerjava.lang.Exceptionpublic void handleDownstream(ChannelHandlerContext ctx, ChannelEvent evt) throws java.lang.Exception
ChannelDownstreamHandlerhandleDownstream in interface ChannelDownstreamHandlerctx - the context object for this handlerevt - the downstream event to process or interceptjava.lang.Exceptionprivate void issueSessionError(ChannelHandlerContext ctx, Channel channel, java.net.SocketAddress remoteAddress, SpdySessionStatus status)
private void issueStreamError(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, 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, ChannelStateEvent e)
private ChannelFuture sendGoAwayFrame(ChannelHandlerContext ctx, Channel channel, java.net.SocketAddress remoteAddress, SpdySessionStatus status)