You can send()/ sendto()get a message with a zero byte in the domain datagram or in the UDP socket, in which case the correct length of 0 bytes is correct. If you see this unexpectedly, check your lenparameter in your call sendto(int fd, void const *buf, size_t len, int flags, struct const *dest, sockles_t addrlen).
Jeff source
share