Replaced the deprecated gethostbyname with getaddrinfo (#47)