Skip to content

Send MQTT packets atomically in a single socket write#49

Merged
python36 merged 1 commit intopython36:masterfrom
centurysys:fix/atomic-send
Mar 25, 2026
Merged

Send MQTT packets atomically in a single socket write#49
python36 merged 1 commit intopython36:masterfrom
centurysys:fix/atomic-send

Conversation

@centurysys
Copy link
Copy Markdown
Contributor

Previously the fixed header and payload were sent in separate async socket writes. Since each write awaits, other tasks could interleave writes on the same socket, potentially corrupting packet framing.

This change builds a single contiguous buffer and sends it in one async write call to ensure packet atomicity.

Previously the fixed header and payload were sent in
separate async socket writes. Since each write awaits,
other tasks could interleave writes on the same socket,
potentially corrupting packet framing.

This change builds a single contiguous buffer and sends
it in one async write call to ensure packet atomicity.

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
@python36 python36 merged commit 9f49168 into python36:master Mar 25, 2026
2 checks passed
@python36
Copy link
Copy Markdown
Owner

Merged! Thanks for the contribution, @centurysys

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.

2 participants