Current ByteChannel interface does not allow a peer to determine whether there are multiple application messages available. Could be useful, for example, if the server wants to handle a set of request from the client in a batch fashion and return the result from multiple request in a single MultiAppPacket.
We could add this method to ByteChannel:
public int available();
// returns number of buffered application message that are available.
// Use 0 if not know.
We could also change the read() method to return an array of byte array (or List).
Yet another approach is add a multiRead() method along the read() method. It would return multiple application messages.
Current ByteChannel interface does not allow a peer to determine whether there are multiple application messages available. Could be useful, for example, if the server wants to handle a set of request from the client in a batch fashion and return the result from multiple request in a single MultiAppPacket.
We could add this method to ByteChannel:
We could also change the read() method to return an array of byte array (or List).
Yet another approach is add a multiRead() method along the read() method. It would return multiple application messages.