Network library: Is there a limit on the size of a byte array sent to a Client via the write() function?

Sorry for not having followed the post.
Soon after my question, I realize that very often the part of the message I was receiving was coming in multiples of 1460 bytes (7300 = 1460*5). So 1460 looks like a “magic number”. But I also got a different “magic number”. The reason for these two different numbers is that the message could be fragmented -) when it is received by the TCP Server, and -) when it is received by the Consumer. The TCP server and the Consumer have different implementations of the TCP functions.
Luckily my original message contains a header, and some info from which the Consumer can compute its length. So I have to read from the TCP stream until I get enough data to complete a message, and keep what is left as the beginning of the next message.

Best regards,
Giulio

1 Like