You can definitely send the array in one send, however you may need to do some extra work. There are problems with its correct interpretation on the receiving side. For example, if you use different computer architectures, you may need to convert integers to network order (for example, htonl).
Another thing to keep in mind is the memory layout. If it is a simple array of integers, then it will be contiguous in memory, and one send can successfully capture all the data. If, although (and this is probably obvious), you have an array with other data, then the layout definitely needs to be considered. A simple example would be if there were pointers to other data in the array, such as a character string, then sending the array would send pointers (not data) and would be pointless to the recipient.
source
share