public class ClientMessageReadHandler extends Object implements ReadHandler
ClientMessage
s from byte chunks. Fragmented messages are merged into single messages before processed.Modifier and Type | Class and Description |
---|---|
static interface |
ClientMessageReadHandler.MessageHandler
Implementers will be responsible to delegate the constructed message
|
Constructor and Description |
---|
ClientMessageReadHandler(SwCounter messageCounter,
ClientMessageReadHandler.MessageHandler messageHandler) |
Modifier and Type | Method and Description |
---|---|
void |
onRead(ByteBuffer src)
A callback to indicate that data is available in the ByteBuffer to be processed.
|
public ClientMessageReadHandler(SwCounter messageCounter, ClientMessageReadHandler.MessageHandler messageHandler)
public void onRead(ByteBuffer src) throws Exception
ReadHandler
onRead
in interface ReadHandler
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. That is a task of the SocketReader
.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 TcpIpConnection
is closed. There is no point continuing with a potentially corrupted stream.Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.