Allow use of runtime TCP connect without ASIO one shot #3171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this commit, the usage of ASIO_ONESHOT was coded into every
outgoing connection created by the runtime. This is a little odd when we
consider that incoming connection can pick their asio flags to use in
_accept.
With the change, selecting asio flags for read/write/one shot is mostly
in the control of the Pony level tcp library. Listeners still start as
non-one shot and read only. It would be reasonable to allow listeners to
select one shot or not, however, at this time, there isn't a need.
Whereas, there is a need for allowing this change. Currently, my Lori
library doesn't work because it doesn't yet support one shot. It worked
with many Pony versions until we fixed a bug where one shot was being
turned off in the runtime after the first event.
Exposing this bug in Lori lead me to check out how we are handling Asio
setup in the runtime. Based on that, the Lori work, and my slow movement
towards allowing TCP and Asio runtimes other than the ones built into
our runtime, I believe this is an important change and a step towards
being about to use non-kernel defined TCP networking with Pony.