@ChannelHandler.Sharable public abstract class FMLIndexedMessageToMessageCodec<A> extends io.netty.handler.codec.MessageToMessageCodec<FMLProxyPacket,A>
Modifier and Type | Field and Description |
---|---|
static io.netty.util.AttributeKey<java.lang.ThreadLocal<java.lang.ref.WeakReference<FMLProxyPacket>>> |
INBOUNDPACKETTRACKER
Make this accessible to subclasses
|
Constructor and Description |
---|
FMLIndexedMessageToMessageCodec() |
Modifier and Type | Method and Description |
---|---|
FMLIndexedMessageToMessageCodec<A> |
addDiscriminator(int discriminator,
java.lang.Class<? extends A> type) |
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
FMLProxyPacket msg,
java.util.List<java.lang.Object> out) |
abstract void |
decodeInto(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf source,
A msg) |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
A msg,
java.util.List<java.lang.Object> out) |
abstract void |
encodeInto(io.netty.channel.ChannelHandlerContext ctx,
A msg,
io.netty.buffer.ByteBuf target) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
testMessageValidity(FMLProxyPacket msg)
Called to verify the message received.
|
acceptInboundMessage, acceptOutboundMessage, channelRead, write
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerRemoved, isSharable
public static final io.netty.util.AttributeKey<java.lang.ThreadLocal<java.lang.ref.WeakReference<FMLProxyPacket>>> INBOUNDPACKETTRACKER
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
handlerAdded
in interface io.netty.channel.ChannelHandler
handlerAdded
in class io.netty.channel.ChannelHandlerAdapter
java.lang.Exception
public FMLIndexedMessageToMessageCodec<A> addDiscriminator(int discriminator, java.lang.Class<? extends A> type)
public abstract void encodeInto(io.netty.channel.ChannelHandlerContext ctx, A msg, io.netty.buffer.ByteBuf target) throws java.lang.Exception
java.lang.Exception
protected final void encode(io.netty.channel.ChannelHandlerContext ctx, A msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
encode
in class io.netty.handler.codec.MessageToMessageCodec<FMLProxyPacket,A>
java.lang.Exception
public abstract void decodeInto(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf source, A msg)
protected final void decode(io.netty.channel.ChannelHandlerContext ctx, FMLProxyPacket msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
decode
in class io.netty.handler.codec.MessageToMessageCodec<FMLProxyPacket,A>
java.lang.Exception
protected void testMessageValidity(FMLProxyPacket msg)
msg
- public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception