In all examples of using bsd sockets on C, an array of characters of a fixed length char buff[255] used to transmit and receive information char buff[255] . For example, read(socketFD, buff, sizeof(buff)); . A couple of questions arise:
Is it necessary to use an array of char, or can I pass arbitrary objects? for example, is it possible to pass
double buff[255]or evenstruct someStructType buff[255]?What happens if you send an array of, for example, 200 elements, and on the receiving side only 100 are counted? When re-reading, we read the same elements, or the next 100 elements?