send big chunk of data over linux sockets

Sending a big chunk of data over linux sockets canĀ  be tricky, because we need to call the write function multiple times. The following snippet assumes a valid socket filedescriptor “socketfd”, after the connection is established. Make sure that PACKETSIZE is smaller or equal to 2^16 and that nbytes equals the amount of bytes of… Continue reading send big chunk of data over linux sockets