Scenario: I have three programs: a TCP Server (written in Processing), and Producer and Consumer (they are not Processing sketches). Producer produces an array of bytes. Producer and Consumer connect to the TCP Server, and Consumer “subscribes” to the messages coming from Producer (the TCP Server handles this).
When Producer sends a byte array to the TCP Server, this forwards it to the Consumer. The max. size of my array is around 31kbytes.
But I noticed that when the size is above (or around 10kbytes), occasionally Consumer does not receive the entire array; and many times it claims it has only received 7300 bytes (this figure occurs often enough not to be considered a coincidence).
I checked the size of the message received by the TCP Server; this is correct. So the problem can be either in the write call that the Server executes, or in the read call in my Consumer (which , I repeat, is not written in Processing).
To debug this, I will add a Processing Client, to see if this receives the message correctly; but does anyone know if “7300” means something in this context? This figure occurs too often when the full message is not received by Consumer.
Thank you and best regards,