Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

unsigned short Socket::resolveService ( const string &  service,
const string &  protocol = "tcp" 
) [static]

Resolve the specified service for the specified protocol to the corresponding port number in host byte order.

Parameters:
service service to resolve (e.g., "http")
protocol protocol of service to resolve. Default is "tcp".

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:


Generated on Thu Jan 13 09:13:08 2011 for ImpalaSrc by  doxygen 1.5.1