Class LegacySimpleServerHandshakeCodec
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.ByteToMessageCodec<ControlMessage>
pt.unl.fct.di.novasys.babel2.channels.legacy.simpleServer.LegacySimpleServerHandshakeCodec
- All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler
public class LegacySimpleServerHandshakeCodec
extends io.netty.handler.codec.ByteToMessageCodec<ControlMessage>
Netty codec for encoding and decoding legacy control and handshake messages.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMagic number expected in legacy control message payloads.static final byteDiscriminant byte identifying legacy control frames.static final io.netty.util.AsciiStringASCII attribute tag identifying the client magic number in legacy handshakes.static final intByte length ofMAGIC_NUMBER_TAG. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newLegacySimpleServerHandshakeCodec. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidencode(io.netty.channel.ChannelHandlerContext ctx, ControlMessage msg, io.netty.buffer.ByteBuf out) Methods inherited from class io.netty.handler.codec.ByteToMessageCodec
acceptOutboundMessage, channelInactive, channelRead, channelReadComplete, decodeLast, handlerAdded, handlerRemoved, writeMethods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
CONTROL_MESSAGE_CODE
public static final byte CONTROL_MESSAGE_CODEDiscriminant byte identifying legacy control frames.- See Also:
-
CONTROL_MAGIC_NUMBER
public static final int CONTROL_MAGIC_NUMBERMagic number expected in legacy control message payloads.- See Also:
-
MAGIC_NUMBER_TAG
public static final io.netty.util.AsciiString MAGIC_NUMBER_TAGASCII attribute tag identifying the client magic number in legacy handshakes. -
MAGIC_NUMBER_TAG_SIZE
public static final int MAGIC_NUMBER_TAG_SIZEByte length ofMAGIC_NUMBER_TAG.
-
-
Constructor Details
-
LegacySimpleServerHandshakeCodec
public LegacySimpleServerHandshakeCodec()Constructs a newLegacySimpleServerHandshakeCodec.
-
-
Method Details
-
encode
protected void encode(io.netty.channel.ChannelHandlerContext ctx, ControlMessage msg, io.netty.buffer.ByteBuf out) throws Exception - Specified by:
encodein classio.netty.handler.codec.ByteToMessageCodec<ControlMessage>- Throws:
Exception
-
decode
protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out) throws Exception - Specified by:
decodein classio.netty.handler.codec.ByteToMessageCodec<ControlMessage>- Throws:
Exception
-