There are several differences, for example in socketHttpConnectV4

struct hostent*     hp;

  if ((hp = gethostbyname(host.c_str())) == NULL)

but in socketHttpConnectV6

  struct addrinfo hints;

if ((status = getaddrinfo(host.c_str(), port_str, &hints, &peer)) != 0) {