Skip to content

Implemented #648. #649

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

Merged
merged 2 commits into from
Jul 26, 2020
Merged

Implemented #648. #649

merged 2 commits into from
Jul 26, 2020

Conversation

redboltz
Copy link
Owner

Added PINGRESP timeout.
If the timeout value is set, when PINGREQ is sent but PINGRESP is not
received until the timeout, then force_disconnect() is called from the
client side internally.

@redboltz redboltz force-pushed the impl_648 branch 2 times, most recently from f730e2c to 6531e2b Compare July 24, 2020 14:14
@redboltz
Copy link
Owner Author

steady_timer is an alias of basic_waitable_timer< chrono::steady_clock >.

Its constructor requires io_context& until 1.69.0
https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/reference/basic_waitable_timer/basic_waitable_timer.html
Since 1.70.0, executor const& version is introduced.
https://www.boost.org/doc/libs/1_70_0/doc/html/boost_asio/reference/basic_waitable_timer/basic_waitable_timer.html

When creating a server side endpoint, socket is passed. I can get executor from the socket using https://www.boost.org/doc/libs/1_73_0/doc/html/boost_asio/reference/basic_stream_socket/get_executor.html .
But I can't get io_context.
In order to get io_context, I need to pass io_context.

If the minimum boost version support updates to 1.70.0, I can use executor based approach.
If it is too new, I need to pass io_context.

Added PINGRESP timeout.
If the timeout value is set, when PINGREQ is sent but PINGRESP is not
received until the timeout, then force_disconnect() is called from the
client side internally.
@codecov
Copy link

codecov bot commented Jul 24, 2020

Codecov Report

Merging #649 into master will decrease coverage by 0.59%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #649      +/-   ##
==========================================
- Coverage   85.12%   84.53%   -0.60%     
==========================================
  Files          40       41       +1     
  Lines        5682     6544     +862     
==========================================
+ Hits         4837     5532     +695     
- Misses        845     1012     +167     

@jonesmz
Copy link
Contributor

jonesmz commented Jul 24, 2020

I have been working on moving away from boost 1.67.
I am now on boost 1.68.
I want to use boost 1.70 within 60 days.

I am OK with change of boost requirement to 1.70 today. Would prefer we wait until I have updated my version of boost, but do not know timeline, so I don't want to hold up the mqtt_cpp project.

@redboltz
Copy link
Owner Author

@jonesmz , thnaks.

I noticed that I can pass a reference io_context without big change. So this PR can work with boost 1.67.0.

@redboltz redboltz merged commit 805df1b into master Jul 26, 2020
@redboltz redboltz deleted the impl_648 branch July 26, 2020 23:42
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