sendto

Socket programming: sendto always fails with errno 22.

I am always getting no bytes sent, with an errno of 22 (Invalid Argument) with this code. The destination_host is set elsewhere and known to be valid, so I really don't see what is going on. MAXMSGSIZE is 1000. No errors, or warnings. I am compiling with -Wall -Werror -pedantic char *data_rec; u_int data_len; int sockfd; uint16_t *...