Dear Boost and ASIO users,
CC: boost@lists.boost.org, asio-users@lists.sourceforge.net
I am writing to ask for comments on the design of and interest in a
generic reliable messaging library based on ASIO. Such a library
could bring to ASIO very considerably improved data transfer
performance over TCP, plus the ability to ignore NAT firewalls. The
design imperatives for such a library are proving tricky to reach
consensus upon, so perhaps the community might be able to help.
Firstly, what features should such a reliable messaging library have?
Here are some for you to consider:
* Should it have wire transport backends with an abstraction from
wire transports, so a UDT backend could be interchangeable with TCP
for example with just a recompile needed? Upper level code need
therefore not consider what format the wire transport takes, just
that messages are reliably delivered or we are told of the connection
failure. Some mechanism for dealing with out of order messages, and
message expiry in case congestion control excessively delays outbound
messages would also be included.
You should be aware that congestion control for a reliable messaging
library means one has no choice but to pace message construction
(i.e. block/EWOULDBLOCK handing out new message send templates),
otherwise one ends up buffering more data for sending than
potentially can ever be delivered. This is because we cannot drop
reliable messages, nor can we pace writes, so pacing new message
construction is the only alternative.
* Should it be zero copy for both receipt and send? If so, we'll have
to break with the existing ASIO API somewhat - namely that
MutableBufferSequence will need to now become
MutableFileOffsetBufferSequence so one can supply scatter/gathers of
user space buffers and kernel side buffers. We'll also have to
templatise the buffer management so client code can supply the
virtualisation (e.g. an iterator) which remaps inbound message
fragments into apparently contiguous regions. By the time we have
done these, the API looks quite different.
* Should it be written using C++ 14 idioms instead of the existing 03
idioms ASIO uses? If so, basing read and write handlers on the C++ 17
proposed experimental::expected