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, priorityPacketsReadchannel, 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, setPriorityPacketsReadinitSrcBuffer, initSrcBufferdst, dst, interceptError, setChannel, src, srcprotected final TcpIpConnection connection
public PacketDecoder(TcpIpConnection connection, Consumer<Packet> dst)
public void handlerAdded()
ChannelHandlerhandlerAdded in class ChannelHandler<InboundHandler,ByteBuffer,Consumer<Packet>>public HandlerStatus onRead() throws Exception
InboundHandleronRead 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 © 2019 Hazelcast, Inc.. All Rights Reserved.