ROSIntegration icon indicating copy to clipboard operation
ROSIntegration copied to clipboard

Fix to avoid bug when reading subscription message header

Open PetterVMC opened this issue 3 years ago • 0 comments

There was a problem that in some environments, after a random time of play (usually a minute or so) the subscription message processing suddenly failed and could not recover.

After investigation, it turns out that this happened if the message header (the first 4 bytes for the message length) arrived in multiple packets, i.e. it could not be read by only one _sock->Recv() instruction. In this case the error message "bytes_read is not 4 in bson_state_read_length==true." would display and from there on no further message processing can be done.

Fixed this by allowing reading of the header multiple times until all 4 bytes have been read.

PetterVMC avatar Aug 31 '22 09:08 PetterVMC