Resolve the specified service for the specified protocol to the corresponding port number in host byte order.
Definition at line 165 of file PracticalSocket.cpp. References Impala::atoi(). 00166 { 00167 struct servent *serv; /* Structure containing service information */ 00168 00169 if ((serv = getservbyname(service.c_str(), protocol.c_str())) == NULL) 00170 return atoi(service.c_str()); /* Service is port number */ 00171 else 00172 return ntohs(serv->s_port); /* Found port (network byte order) by name */ 00173 }
Here is the call graph for this function:
|