Receiver.recv

Receive message data for the current delivery.

If the caller takes all the bytes the Receiver currently has for this delivery then it is removed from the Connection's work list.

Before considering a delivery to be complete, the caller should examine {@link Delivery#isPartial()}. If the delivery is partial, the caller should call {@link #recv(byte[], int, int)} again to receive the additional bytes once the Delivery appears again on the Connection work-list.

TODO might the flags other than IO_WORK in DeliveryImpl also prevent the work list being pruned? e.g. what if a slow JMS consumer receives a disposition frame containing state=RELEASED? This is not IO_WORK.

@param bytes the destination array where the message data is written @param offset index in the array to start writing data at @param size the maximum number of bytes to write

@return number of bytes written. -1 if there are no more bytes for the current delivery.

@see #current()

  1. int recv(byte[] bytes, int offset, int size)
    interface Receiver
    int
    recv
    (
    byte[] bytes
    ,
    int offset
    ,
    int size
    )
  2. int recv(WritableBuffer buffer)
  3. ReadableBuffer recv()

Meta