service can be a port number passed as string, such as "80", or a service name, e.g.
res is a pointer that points to a new addrinfo structure with the information requested after successful completion of the function.