connectivecpp / chops-net-ip

Chops Net IP ("C"onnective "H"andcrafted "Op"enwork "S"oftware), a tasty C++ library that makes asynchronous IP network coding fun!
Boost Software License 1.0
7 stars 3 forks source link

Consider providing a future-based send method #35

Open cliffg-softwarelibre opened 5 years ago

cliffg-softwarelibre commented 5 years ago

An alternative to output queues for outgoing data is to let applications send a message or buffer one at a time with some form of notification when each write completes. This would require a send method that returns a std::future, which resolves when the write completes. Discussion is needed as to whether the application would be completely responsible for buffer lifetime management, or whether we require some form of reference count or move (or similar) for the output buffer.

Chops Net IP would need to track whether a write is in progress or not. The library should prevent applications from more than one write at a time (on a given connection).

RAgerone commented 5 years ago

Here's the documentation for future. I'd be interested in picking up this task. https://en.cppreference.com/w/cpp/thread/future

cliffg-softwarelibre commented 5 years ago

This is related to https://github.com/connectivecpp/chops-net-ip/issues/11 and https://github.com/connectivecpp/chops-net-ip/issues/10. I'll write a discussion in the team area to get us started (this will be a discussion between me, Nathan, and Roxanne).