public class MemberChannelInboundHandler extends 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
,
MemberChannelOutboundHandler
Modifier and Type | Field and Description |
---|---|
protected TcpIpConnection |
connection |
protected Packet |
packet |
normalPacketsRead, priorityPacketsRead
Constructor and Description |
---|
MemberChannelInboundHandler(TcpIpConnection connection,
PacketHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected void |
handlePacket(Packet packet) |
void |
onRead(ByteBuffer src)
A callback to indicate that data is available in the src ByteBuffer to be processed.
|
setNormalPacketsRead, setPriorityPacketsRead
protected final TcpIpConnection connection
protected Packet packet
public MemberChannelInboundHandler(TcpIpConnection connection, PacketHandler handler)
public void onRead(ByteBuffer src) throws Exception
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 © 2017 Hazelcast, Inc.. All Rights Reserved.