Skip to content

Fix: Use blocking socket only during publishing if configured #141

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

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

Namoshek
Copy link
Collaborator

This PR replaces #139 and fixes the implementation of #135.

Issue:
Currently, the connection setting added in #135 has no effect due to a typo in the assignment.

Background:
Due to the nature of MQTT and how network communication works, non-blocking mode for sockets is quite essential when reading data received from the MQTT broker. If such reads are performed in blocking mode and no data is received from the broker over a long period of time, the connection may timeout.

Solution:
This PR fixes the typo in the connection settings. Because this fix introduces an issue when blocking mode is used for the socket, the meaning of the setting has been changed slightly. It now only affects the publishing of messages and is not used for reads on the socket.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@alysdal
Copy link

alysdal commented Jan 11, 2023

Hi @Namoshek,

I can confirm that this works in my case for sending larger binary packets (400kb) while being able to subscribe to topics using a single connection. (#133)

Thanks a lot for working this out.

@Namoshek Namoshek merged commit dc40a6d into master Jan 13, 2023
@Namoshek Namoshek deleted the fix/connection-setting-blocked-socket branch January 13, 2023 05:41
@Namoshek
Copy link
Collaborator Author

Sorry for the delay, published as v1.7.1.

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

Successfully merging this pull request may close these issues.

None yet

2 participants