Skip to content

Conversation

@jameshilliard
Copy link
Contributor

@jameshilliard jameshilliard commented Feb 21, 2025

Ensure we don't have any non-relevant data in the buffer.

Haven't tested yet but I think this is the expected behavior based on this comment.

)
return response
except asyncio.exceptions.TimeoutError:
self.recv_buffer = b""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong place, since it can cause conflicts with the active callback.

It would be better placed in line 140, which is before the callback is active.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah I guess purging the buffer before doing the write makes more sense.

Ensure we don't have any non-relevant data in the buffer.
@jameshilliard jameshilliard changed the title Flush recv_buffer on timeout Flush recv_buffer before each transaction write. Feb 22, 2025
@janiversen janiversen merged commit c55d05b into pymodbus-dev:dev Feb 22, 2025
1 check passed
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