robertobucher / pysimCoder

Block diagram editor and real time code generator for Python
GNU General Public License v3.0
142 stars 31 forks source link

RT scope utility: ensure correct handling of TCP stream with unaligned chunks #62

Closed ppisa closed 1 year ago

ppisa commented 1 year ago

The TCP recv even in blocking mode is guaranteed only to wait for single byte. It can return with les bytes read than requested and if the data are delivered in packets not exactly aligned to the N * 8 bytes equivalent to configured number of signals then RT scope fails with message like

data = self.st.unpack(buf)
struct.error: unpack requires a buffer of 24 bytes