Boost logo

Boost :

From: Takatoshi Kondo (redboltz_at_[hidden])
Date: 2024-04-30 03:31:06


Hi Klemens, Joaquin
Thanks you for the feedbacks:

https://github.com/redboltz/async_mqtt/blob/main/example/ep_cpp20coro_mqtt_client.cpp
This is the code that demonstrates simple MQTT client using async_mqtt
with C++20 corutine.

Underlying parts (name resolution, TCP, TLS, WS handshaking) are
intentionally exclude from async_mqtt. Because users might want to
customize the layers. It is similar as Boost.Beast design
https://github.com/boostorg/beast/blob/develop/example/websocket/client/coro/websocket_client_coro.cpp

I think that sending MQTT packet is simple too.

However, I think that it is not a big difference.

The biggest difference between async-mqtt5 and async_mqtt is the
meaning of CompletionHandler.
I guess that Klemens pointed is that. Am I understanding correctly?

async_mqtt send() function's CompletionHandler is invoked when the
underlying async_write is completed.
async-mqtt5 sending functions (async_subscribe, async_unsubscribe, and
async_publish) CompletionHandler is invoked the corresponding
acknolege MQTT packet (SUBACK, UNSUBACK, PUBACK, PUBCOMP) is received.

async_mqtt recv() function's CompletionHandler is invoked when any
MQTT packet is receied, in addition when connection error is happened.
async-mqtt5 async_receive() function's CompletionHandler is invoked
when MQTT PUBLISH packet is received.

As Klemens pointed out, async-mqtt5 easier to use than async_mqtt for
casual usecases thanks to its higher level APIs.
I guess that the high level APIs can be implemented on async_mqtt's
comparatively low level APIs.I will consider what is the good
abstraction for higher level APIs, based on your feedback.

Thanks,
Takatoshi Kondo

2024年4月30日(火) 2:12 Joaquín M López Muñoz via Boost <boost_at_[hidden]>:
>
>
> > No dia 29 de abr. de 2024, às 17:42, Takatoshi Kondo via Boost <boost_at_[hidden]> escreveu:
> >
> > Dear Boost Developers,
> >
> > I'd like to propose a MQTT library to the Boost Libraries.
>
> I’m endorsing the lib, but more generally I’m endorsing the presence in Boost of an MQTT client/server facility, which connects to the point raised by Klemens on having a conversation on the merits/synergies of the two current proposals.
>
> Joaquín M López Muñoz
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk