Skip to content
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

mosquitto_sub with -C and -W options #3009

Open
gsaviane opened this issue Feb 27, 2024 · 1 comment
Open

mosquitto_sub with -C and -W options #3009

gsaviane opened this issue Feb 27, 2024 · 1 comment

Comments

@gsaviane
Copy link

Running the following command over a mosquitto 2.0.11 installation

mosquitto_sub -h host -p port -t topic -C 1 and -W 10

waits for the timeout to expire whether or not a message is read. Since the -C option says:

Disconnect and exit the program immediately after the given count of messages have been received. This may be useful in shell scripts where on a single status value is required, for example.

I would expect that the timeout takes place only when there are no messages in the topic, and it is ignored when a message is actually read, respecting the -C specs.

@Daedaluz
Copy link
Contributor

Daedaluz commented Mar 1, 2024

can you try with a newer version?
This works on 2.0.18, unless i misunderstood something.

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

No branches or pull requests

2 participants