C# Class Helios.Codecs.ByteToMessageDecoder

Used for providing message framing capabilities for inbound data
Inheritance: Helios.Channels.ChannelHandlerAdapter
Afficher le fichier Open project: helios-io/helios

Méthodes publiques

Свойство Type Description
Merge Cumulator

Méthodes publiques

Méthode Description
ChannelInactive ( IChannelHandlerContext context ) : void
ChannelRead ( IChannelHandlerContext context, object message ) : void
ChannelReadComplete ( IChannelHandlerContext context ) : void
HandlerRemoved ( IChannelHandlerContext context ) : void
SetCumulator ( Cumulator cumulator ) : void

Set the Cumulator function used by this decoder.

SetDiscardAfterReads ( int discardAfterReads ) : void

Set the number of reads after whcih IByteBuf.DiscardSomeReadBytes are called to free up memory. The default is 16.

SetSingleDecode ( bool singleDecode ) : void

When set to true then only one message is decoded on each IChannelHandler.ChannelRead. Defaults to false for performance reasons.

May be useful if oyu need to do a protocol upgrade and want to make sure nothing is mixed up.

Méthodes protégées

Méthode Description
CallDecode ( IChannelHandlerContext context, IByteBuf input, List output ) : void
Decode ( IChannelHandlerContext context, IByteBuf input, List output ) : void
DecodeLast ( IChannelHandlerContext context, IByteBuf input, List output ) : void

Called one last time when the IChannelHandlerContext goes inactive, which means the IChannelHandler.ChannelInactive was triggered. By default this will jsut call Decode but sub-classes may override this for special cleanup operations.

DiscardSomeReadBytes ( ) : void
HandlerRemovedInternal ( IChannelHandlerContext context ) : void

Private Methods

Méthode Description
ChannelInputClosed ( IChannelHandlerContext context, bool callChannelInactive ) : void
ExpandCumulation ( IByteBufAllocator alloc, IByteBuf cumulation, int readable ) : IByteBuf

Expand the existing cumulative IByteBuf.

FireChannelRead ( IChannelHandlerContext context, List msgs, int numElements ) : void

Method Details

CallDecode() protected méthode

protected CallDecode ( IChannelHandlerContext context, IByteBuf input, List output ) : void
context IChannelHandlerContext
input IByteBuf
output List
Résultat void

ChannelInactive() public méthode

public ChannelInactive ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

ChannelRead() public méthode

public ChannelRead ( IChannelHandlerContext context, object message ) : void
context IChannelHandlerContext
message object
Résultat void

ChannelReadComplete() public méthode

public ChannelReadComplete ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

Decode() protected abstract méthode

protected abstract Decode ( IChannelHandlerContext context, IByteBuf input, List output ) : void
context IChannelHandlerContext
input IByteBuf
output List
Résultat void

DecodeLast() protected méthode

Called one last time when the IChannelHandlerContext goes inactive, which means the IChannelHandler.ChannelInactive was triggered. By default this will jsut call Decode but sub-classes may override this for special cleanup operations.
protected DecodeLast ( IChannelHandlerContext context, IByteBuf input, List output ) : void
context IChannelHandlerContext
input IByteBuf
output List
Résultat void

DiscardSomeReadBytes() protected méthode

protected DiscardSomeReadBytes ( ) : void
Résultat void

HandlerRemoved() public méthode

public HandlerRemoved ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

HandlerRemovedInternal() protected méthode

protected HandlerRemovedInternal ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

SetCumulator() public méthode

Set the Cumulator function used by this decoder.
public SetCumulator ( Cumulator cumulator ) : void
cumulator Cumulator
Résultat void

SetDiscardAfterReads() public méthode

Set the number of reads after whcih IByteBuf.DiscardSomeReadBytes are called to free up memory. The default is 16.
public SetDiscardAfterReads ( int discardAfterReads ) : void
discardAfterReads int
Résultat void

SetSingleDecode() public méthode

When set to true then only one message is decoded on each IChannelHandler.ChannelRead. Defaults to false for performance reasons.
May be useful if oyu need to do a protocol upgrade and want to make sure nothing is mixed up.
public SetSingleDecode ( bool singleDecode ) : void
singleDecode bool The toggle for single decoding
Résultat void

Property Details

Merge public_oe static_oe property

public static Cumulator Merge
Résultat Cumulator