Great error handling. Well, check return code of getaddrinfo so that we don't crash on a lookup failure ...