Most applications will eventually need to convert host/service names to
sockaddr structures and
sockaddr structures to host/service names. The BSD Socket Library has two functions to assist with these conversions:
Getaddrinfo(): This is a function that will return information about a given host/service name. The results are returned in an
Getnameinfo(): This is a function that will return the host and service names, given a
getnameinfo() functions make the
getservbyport() functions obsolete. One of the main advantages that the
getnameinfo() functions has over the obsolete functions is that they ...