Code Monkey home page Code Monkey logo

Comments (3)

shamblett avatar shamblett commented on July 26, 2024

If you use a high QOS level such as 1 or 2 the client will handle re transmission for you, see here. This however is transparent to you unless you listen to the published message stream, from the client api -

 /// Published message stream. A publish message is added to this
  /// stream on completion of the message publishing protocol for a Qos level.
  /// Attach listeners only after connect has been called.
  Stream<MqttPublishMessage>? get published =>
      publishingManager != null ? publishingManager!.published.stream : null;

from mqtt_client.

TongCong12138 avatar TongCong12138 commented on July 26, 2024

If you use a high QOS level such as 1 or 2 the client will handle re transmission for you, see here. This however is transparent to you unless you listen to the published message stream, from the client api -

 /// Published message stream. A publish message is added to this
  /// stream on completion of the message publishing protocol for a Qos level.
  /// Attach listeners only after connect has been called.
  Stream<MqttPublishMessage>? get published =>
      publishingManager != null ? publishingManager!.published.stream : null;

Hello, I'm a newbie. Isn't there a method to listen specifically for successful delivery? Similar to Bluetooth write success callback. Any sample code? Thank you very much

from mqtt_client.

shamblett avatar shamblett commented on July 26, 2024

All the client does is to place successfully sent messages on the publish stream. How you ascertain your messages are being delivered to the broker as you expect is up to you, you could not send the next message until the last one you have sent appears on the publish queue, you could place a token in the payload say and keep track that way, there are other ways. The client shouldn't constrain you in how you do this.

Listening on the publish stream is like a 'write success callback' as you say above.

from mqtt_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.