EvenAR / node-simconnect

A cross platform SimConnect client library for Node.JS
GNU Lesser General Public License v3.0
95 stars 33 forks source link

Fix issue with large messages over network connection #96

Closed EvenAR closed 11 months ago

EvenAR commented 11 months ago

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.