public class PacketDecoder extends InboundHandlerWithCounters<ByteBuffer,Consumer<Packet>>
InboundHandler
for member to member communication.
It reads as many packets from the src ByteBuffer
as possible, and
each of the Packets is send to the destination.Consumer
,
PacketEncoder
Modifier and Type | Field and Description |
---|---|
protected TcpIpConnection |
connection |
normalPacketsRead, priorityPacketsRead
channel, dst, src
Constructor and Description |
---|
PacketDecoder(TcpIpConnection connection,
Consumer<Packet> dst) |
Modifier and Type | Method and Description |
---|---|
void |
handlerAdded()
Gets called when this ChannelHandler is added to the pipeline.
|
protected void |
onPacketComplete(Packet packet) |
HandlerStatus |
onRead()
A callback to indicate that data is available in the src to be
processed.
|
setNormalPacketsRead, setPriorityPacketsRead
initSrcBuffer, initSrcBuffer
dst, dst, interceptError, setChannel, src, src
protected final TcpIpConnection connection
public PacketDecoder(TcpIpConnection connection, Consumer<Packet> dst)
public void handlerAdded()
ChannelHandler
handlerAdded
in class ChannelHandler<InboundHandler,ByteBuffer,Consumer<Packet>>
public HandlerStatus onRead() throws Exception
InboundHandler
onRead
in class InboundHandler<ByteBuffer,Consumer<Packet>>
Exception
- if something fails while reading data from the src
or processing the data (e.g. when a Packet fails to get processed). When an
exception is thrown, the ChannelErrorHandler
is called.protected void onPacketComplete(Packet packet)
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.