Which one of the following function returns the port number of a specified service?
A
getportname()
B
getservername()
C
getserverbyname()
D
getservbyname()
Correct Answer: getservbyname()
The function fgetservbyname() returns the port number for a given Internet service and protocol. Example-getservbyname(“http”,”tcp”) will return 80.