Class NettyPacketEncoder
java.lang.Object
io.netty5.channel.ChannelHandlerAdapter
io.netty5.handler.codec.MessageToByteEncoder<Packet>
eu.cloudnetservice.driver.network.netty.codec.NettyPacketEncoder
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
@Internal
public final class NettyPacketEncoder
extends io.netty5.handler.codec.MessageToByteEncoder<Packet>
An internal implementation of the packet encoder used for client to server communication.
A packet always contains the following data:
- The numeric id of the channel being sent to, by default a var int.
- An optional query unique id if the packet is a query.
- The data transferred to this component, might be empty.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.netty5.buffer.BufferallocateBuffer(@NonNull io.netty5.channel.ChannelHandlerContext ctx, @NonNull Packet msg) protected voidencode(@NonNull io.netty5.channel.ChannelHandlerContext ctx, @NonNull Packet msg, @NonNull io.netty5.buffer.Buffer out) booleanMethods inherited from class io.netty5.handler.codec.MessageToByteEncoder
acceptOutboundMessage, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInactive, channelInboundEvent, channelRead, channelReadComplete, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerAdded, handlerRemoved, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NettyPacketEncoder
public NettyPacketEncoder()
-
-
Method Details
-
allocateBuffer
-
encode
-
isSharable
public boolean isSharable()
-