The GETMSG/PUTMSG commands should be packetized.

Quoting from an email exchange with Nicolas Williams:

With respect to asynchrony, another solution would be to packetize message data. This would complicate the protocol somewhat, but not all that much, and it could be optional. The benefits are large:

  • multiplexing of message get/put operations

  • restart of failed transfers of large messages (say your connection dies at the 9MB mark of a 23MB message, well, you should be able to restart the download from the point where it broke)

  • no need for multiple connections

There could be:

  • simple get/put (not packetized)

  • optional-to-implement packetized get with optional start-at offset

  • optional-to-implement packetized, transactional put: first the client requests to put a message of a given size, the server assigns a message ID and the client does writes every so often until the transfer is complete, at which point the transaction completes and the message appears in the mailbox

No need for sequencing if we assume an ordered delivery transport such as TCP -- just make sure packets are sent in order.

This should be added to the protocol. Work on implementation.

Some thoughts:

  • Default packet-size?

  • How to define which offset?

    • Number of packets, or actual offset?