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.
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.