redboltz / async_mqtt

Asynchronous MQTT communication library based on Boost.Asio
Boost Software License 1.0
77 stars 10 forks source link

Refined error management. #286

Closed redboltz closed 1 month ago

redboltz commented 1 month ago

All async function could return error. async_recv complete with error always started closing process. But it could intentional cancel (operation_aborted). In this case, no longer start closing process. Just report error.

async_send needs to care about packet_id. Basically, packet_id ownership is moved to the library if async_send() is called. So if error happens, it should be released by async_send() if releasing is needed.

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.19%. Comparing base (95e0b73) to head (83f7371).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/redboltz/async_mqtt/pull/286/graphs/tree.svg?width=650&height=150&src=pr&token=21ZT59CMM5&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Takatoshi+Kondo)](https://app.codecov.io/gh/redboltz/async_mqtt/pull/286?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Takatoshi+Kondo) ```diff @@ Coverage Diff @@ ## main #286 +/- ## ========================================== + Coverage 94.17% 94.19% +0.02% ========================================== Files 150 150 Lines 8921 8935 +14 ========================================== + Hits 8401 8416 +15 + Misses 520 519 -1 ``` | [Files](https://app.codecov.io/gh/redboltz/async_mqtt/pull/286?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Takatoshi+Kondo) | Coverage Δ | | |---|---|---| | [include/async\_mqtt/endpoint.hpp](https://app.codecov.io/gh/redboltz/async_mqtt/pull/286?src=pr&el=tree&filepath=include%2Fasync_mqtt%2Fendpoint.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Takatoshi+Kondo#diff-aW5jbHVkZS9hc3luY19tcXR0L2VuZHBvaW50LmhwcA==) | `100.00% <ø> (ø)` | | | [include/async\_mqtt/impl/endpoint\_recv.hpp](https://app.codecov.io/gh/redboltz/async_mqtt/pull/286?src=pr&el=tree&filepath=include%2Fasync_mqtt%2Fimpl%2Fendpoint_recv.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Takatoshi+Kondo#diff-aW5jbHVkZS9hc3luY19tcXR0L2ltcGwvZW5kcG9pbnRfcmVjdi5ocHA=) | `70.85% <100.00%> (+0.24%)` | :arrow_up: | | [include/async\_mqtt/impl/endpoint\_send.hpp](https://app.codecov.io/gh/redboltz/async_mqtt/pull/286?src=pr&el=tree&filepath=include%2Fasync_mqtt%2Fimpl%2Fendpoint_send.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Takatoshi+Kondo#diff-aW5jbHVkZS9hc3luY19tcXR0L2ltcGwvZW5kcG9pbnRfc2VuZC5ocHA=) | `86.62% <92.30%> (+0.66%)` | :arrow_up: |