Module id.ICE

Class MessageReceiver

Object
MessageReceiver
All Implemented Interfaces:
CompletionHandler<Integer,AsynchronousSocketChannel>

public class MessageReceiver extends Object implements CompletionHandler<Integer,AsynchronousSocketChannel>
This handler acts as a message receiver and is notified each time server reads some data from the client.

All read requests are done asynchronously. It means that this receiver may be called with different amounts of data read each time.

Receiver relies on message scanner to extract a message from a stream of bytes and then it passes them back to the looper.

Each time receiver reads new portion of data it appends it to internal buffer and then it uses scanner to tell where message ends in this buffer and another begins.