1. In socket_open_tcp_client(): use getaddrinfo() instead of gethostbyname().