public class PacketDecoder extends com.hazelcast.internal.networking.nio.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 |
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) |
com.hazelcast.internal.networking.HandlerStatus |
onRead()
A callback to indicate that data is available in the src to be
processed.
|
setNormalPacketsRead, setPriorityPacketsRead
initSrcBuffer, initSrcBuffer
protected final TcpIpConnection connection
public PacketDecoder(TcpIpConnection connection, Consumer<Packet> dst)
public void handlerAdded()
com.hazelcast.internal.networking.ChannelHandler
handlerAdded
in class com.hazelcast.internal.networking.ChannelHandler<com.hazelcast.internal.networking.InboundHandler,ByteBuffer,Consumer<Packet>>
public com.hazelcast.internal.networking.HandlerStatus onRead() throws Exception
com.hazelcast.internal.networking.InboundHandler
onRead
in class com.hazelcast.internal.networking.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.