public class SpdyFrameCodec extends ByteToMessageDecoder implements SpdyFrameDecoderDelegate
ChannelHandler
that encodes and decodes SPDY Frames.ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable, ChannelHandler.Skip
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Modifier | Constructor and Description |
---|---|
|
SpdyFrameCodec(SpdyVersion version)
Creates a new instance with the specified
version and
the default decoder and encoder options
(maxChunkSize (8192) , maxHeaderSize (16384) ,
compressionLevel (6) , windowBits (15) ,
and memLevel (8) ). |
|
SpdyFrameCodec(SpdyVersion version,
int maxChunkSize,
int maxHeaderSize,
int compressionLevel,
int windowBits,
int memLevel)
Creates a new instance with the specified decoder and encoder options.
|
protected |
SpdyFrameCodec(SpdyVersion version,
int maxChunkSize,
io.netty.handler.codec.spdy.SpdyHeaderBlockDecoder spdyHeaderBlockDecoder,
io.netty.handler.codec.spdy.SpdyHeaderBlockEncoder spdyHeaderBlockEncoder) |
Modifier and Type | Method and Description |
---|---|
protected void |
decode(ChannelHandlerContext ctx,
ByteBuf in,
List<Object> out)
Decode the from one
ByteBuf to an other. |
void |
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
void |
readDataFrame(int streamId,
boolean last,
ByteBuf data)
Called when a DATA frame is received.
|
void |
readFrameError(String message)
Called when an unrecoverable session error has occurred.
|
void |
readGoAwayFrame(int lastGoodStreamId,
int statusCode)
Called when a GOAWAY frame is received.
|
void |
readHeaderBlock(ByteBuf headerBlock)
Called when the header block within a SYN_STREAM, SYN_REPLY, or HEADERS frame is received.
|
void |
readHeaderBlockEnd()
Called when an entire header block has been received.
|
void |
readHeadersFrame(int streamId,
boolean last)
Called when a HEADERS frame is received.
|
void |
readPingFrame(int id)
Called when a PING frame is received.
|
void |
readRstStreamFrame(int streamId,
int statusCode)
Called when a RST_STREAM frame is received.
|
void |
readSetting(int id,
int value,
boolean persistValue,
boolean persisted)
Called when an individual setting within a SETTINGS frame is received.
|
void |
readSettingsEnd()
Called when the entire SETTINGS frame has been received.
|
void |
readSettingsFrame(boolean clearPersisted)
Called when a SETTINGS frame is received.
|
void |
readSynReplyFrame(int streamId,
boolean last)
Called when a SYN_REPLY frame is received.
|
void |
readSynStreamFrame(int streamId,
int associatedToStreamId,
byte priority,
boolean last,
boolean unidirectional)
Called when a SYN_STREAM frame is received.
|
void |
readWindowUpdateFrame(int streamId,
int deltaWindowSize)
Called when a WINDOW_UPDATE frame is received.
|
void |
write(ChannelHandlerContext ctx,
Object msg,
ChannelPromise promise)
Calls
ChannelHandlerContext.write(Object) to forward
to the next ChannelHandler in the ChannelPipeline . |
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setSingleDecode
bind, channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, isSharable, read, userEventTriggered
public SpdyFrameCodec(SpdyVersion version)
version
and
the default decoder and encoder options
(maxChunkSize (8192)
, maxHeaderSize (16384)
,
compressionLevel (6)
, windowBits (15)
,
and memLevel (8)
).public SpdyFrameCodec(SpdyVersion version, int maxChunkSize, int maxHeaderSize, int compressionLevel, int windowBits, int memLevel)
protected SpdyFrameCodec(SpdyVersion version, int maxChunkSize, io.netty.handler.codec.spdy.SpdyHeaderBlockDecoder spdyHeaderBlockDecoder, io.netty.handler.codec.spdy.SpdyHeaderBlockEncoder spdyHeaderBlockEncoder)
public void handlerAdded(ChannelHandlerContext ctx) throws Exception
ChannelHandlerAdapter
handlerAdded
in interface ChannelHandler
handlerAdded
in class ChannelHandlerAdapter
Exception
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception
ByteToMessageDecoder
ByteBuf
to an other. This method will be called till either the input
ByteBuf
has nothing to read when return from this method or till nothing was read from the input
ByteBuf
.decode
in class ByteToMessageDecoder
ctx
- the ChannelHandlerContext
which this ByteToMessageDecoder
belongs toin
- the ByteBuf
from which to read dataout
- the List
to which decoded messages should be addedException
- is thrown if an error accourpublic void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
ChannelHandlerAdapter
ChannelHandlerContext.write(Object)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.write
in interface ChannelHandler
write
in class ChannelHandlerAdapter
ctx
- the ChannelHandlerContext
for which the write operation is mademsg
- the message to writepromise
- the ChannelPromise
to notify once the operation completesException
- thrown if an error accourpublic void readDataFrame(int streamId, boolean last, ByteBuf data)
SpdyFrameDecoderDelegate
readDataFrame
in interface SpdyFrameDecoderDelegate
public void readSynStreamFrame(int streamId, int associatedToStreamId, byte priority, boolean last, boolean unidirectional)
SpdyFrameDecoderDelegate
readSynStreamFrame
in interface SpdyFrameDecoderDelegate
public void readSynReplyFrame(int streamId, boolean last)
SpdyFrameDecoderDelegate
readSynReplyFrame
in interface SpdyFrameDecoderDelegate
public void readRstStreamFrame(int streamId, int statusCode)
SpdyFrameDecoderDelegate
readRstStreamFrame
in interface SpdyFrameDecoderDelegate
public void readSettingsFrame(boolean clearPersisted)
SpdyFrameDecoderDelegate
readSettingsFrame
in interface SpdyFrameDecoderDelegate
public void readSetting(int id, int value, boolean persistValue, boolean persisted)
SpdyFrameDecoderDelegate
readSetting
in interface SpdyFrameDecoderDelegate
public void readSettingsEnd()
SpdyFrameDecoderDelegate
readSettingsEnd
in interface SpdyFrameDecoderDelegate
public void readPingFrame(int id)
SpdyFrameDecoderDelegate
readPingFrame
in interface SpdyFrameDecoderDelegate
public void readGoAwayFrame(int lastGoodStreamId, int statusCode)
SpdyFrameDecoderDelegate
readGoAwayFrame
in interface SpdyFrameDecoderDelegate
public void readHeadersFrame(int streamId, boolean last)
SpdyFrameDecoderDelegate
readHeadersFrame
in interface SpdyFrameDecoderDelegate
public void readWindowUpdateFrame(int streamId, int deltaWindowSize)
SpdyFrameDecoderDelegate
readWindowUpdateFrame
in interface SpdyFrameDecoderDelegate
public void readHeaderBlock(ByteBuf headerBlock)
SpdyFrameDecoderDelegate
readHeaderBlock
in interface SpdyFrameDecoderDelegate
public void readHeaderBlockEnd()
SpdyFrameDecoderDelegate
readHeaderBlockEnd
in interface SpdyFrameDecoderDelegate
public void readFrameError(String message)
SpdyFrameDecoderDelegate
readFrameError
in interface SpdyFrameDecoderDelegate
Copyright © 2008–2015 The Netty Project. All rights reserved.