public class PacketDecoder
extends com.hazelcast.internal.networking.nio.ChannelInboundHandlerWithCounters
ChannelInboundHandler
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 PacketHandler
.PacketHandler
,
PacketEncoder
Modifier and Type | Field and Description |
---|---|
protected TcpIpConnection |
connection |
Constructor and Description |
---|
PacketDecoder(TcpIpConnection connection,
com.hazelcast.spi.impl.PacketHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected void |
onPacketComplete(Packet packet) |
void |
onRead(ByteBuffer src)
A callback to indicate that data is available in the src ByteBuffer to be processed.
|
protected final TcpIpConnection connection
public PacketDecoder(TcpIpConnection connection, com.hazelcast.spi.impl.PacketHandler handler)
public void onRead(ByteBuffer src) throws Exception
com.hazelcast.internal.networking.ChannelInboundHandler
src
- the ByteBuffer containing the data to read. The ByteBuffer is already in reading mode and when completed,
should not be converted to write-mode using clear/compact.Exception
- if something fails while reading data from the ByteBuffer or processing the data (e.g. when a Packet
fails to get processed). When an exception is thrown, the ChannelErrorHandler
is called.Copyright © 2018 Hazelcast, Inc.. All rights reserved.