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

Fix issue with large messages over network connection #96

Merged
merged 1 commit into from
Dec 23, 2023

Conversation

EvenAR
Copy link
Owner

@EvenAR EvenAR commented Dec 22, 2023

Alternative approach for fixing #91 (see #92)

When using a networked connection, large SimConnect messages (e.g. facilities lists) are most likely to be split into multiple TCP packets/chunks. The old code assume that Socket.read(<len>) blocks until the full <len> is received - which is not the case. The new code will put all received data in a buffer and wait for it to become long enough before trying to parse it as a SimConnect message.

@EvenAR EvenAR changed the title Fix issue with large SimConnect and network conn Fix issue with large messages over network connection Dec 22, 2023
Fixes #91

When using a networked connection, large SimConnect messages
(e.g. facilities lists) are most likely to be split into multiple
TCP packets/chunks. The old code assume that `Socket.read(<len>)`
blocks until the full <len> is received - which is not the case.
The new code will put all received data in a buffer and wait for
it to become long enough before trying to parse the data.
@EvenAR EvenAR merged commit e81a170 into master Dec 23, 2023
11 checks passed
@EvenAR EvenAR deleted the fix-socket-issues branch December 23, 2023 12:09
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

1 participant