Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of runtime TCP connect without ASIO one shot #3171

Merged
merged 1 commit into from
Jun 8, 2019
Merged

Conversation

SeanTAllen
Copy link
Member

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.

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.
@SeanTAllen SeanTAllen requested review from sylvanc and dipinhora June 8, 2019 15:25
@SeanTAllen SeanTAllen merged commit 5f29b1b into master Jun 8, 2019
@SeanTAllen SeanTAllen deleted the tcp-asio branch June 8, 2019 17:16
SeanTAllen added a commit that referenced this pull request Jun 18, 2019
patches11 pushed a commit to patches11/ponyc that referenced this pull request Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants