-
Notifications
You must be signed in to change notification settings - Fork 8
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
Provide an example of how to receive only one retained message #17
Comments
Dmitry Katsubo skribis 2022-02-17 14:52 (-0800):
I wonder how to implement the following functionality:
```
mosquitto_sub -C 1 -t ...
```
i.e. read one (retained) message from the topic.
The accompanied command line utility `mqtt-simple` supports this feature. You could look at that for inspiration.
|
Thanks. The utility calls
The only way I see this can be implemented with utility approach is when:
Then it can be implemented the suggested way:
|
See this code used in one of our libraries: |
Thanks for the example, that is actually what I was thinking about: call Currently
|
I wonder how to implement the following functionality:
i.e. read one (retained) message from the topic.
The following code does not wait for 5 seconds and also does not receive any message from the topic (prints
Tick: 1
to the console):Thanks in advance!
The text was updated successfully, but these errors were encountered: