struct hostent->h_addr_list is a pointer to an array of addresses.

We want a pointer to the first address, not to the entire array.
The result was that we tried to connect to a nonsensical address.