atlas-engineer / cl-electron

Lisp Interface to Electron.
BSD 3-Clause "New" or "Revised" License
16 stars 1 forks source link

Protocol: resolve messages greater than 2^16 in size. #20

Closed jmercouris closed 7 months ago

jmercouris commented 7 months ago

NodeJS will automatically invoke client.on('data'...) when the data exceeds 2^16 characters. This means that long messages will be chunked into multiple small blocks, preventing us from reconstituting them properly.

The changes here allow us to buffer the results of a transmission greater than 2^16 in size. Therefore, we can have messages greater than this size.

In order to achieve this, we append data to message_buffer until we receive the control signal of 'end of transmission' via our check with the transmission_end_index.

Fixes #19.

jmercouris commented 7 months ago

Right! Will do!

jmercouris commented 7 months ago

I've also thought that we may create a server PER protocol to avoid race conditions and improve throughput. Just another thought for potential future work!