| 166 | } |
| 167 | |
| 168 | unsigned short Socket::resolveService(const string &service, |
| 169 | const string &protocol) { |
| 170 | struct servent *serv; /* Structure containing service information */ |
| 171 | |
| 172 | if ((serv = getservbyname(service.c_str(), protocol.c_str())) == NULL) |
| 173 | return atoi(service.c_str()); /* Service is port number */ |
| 174 | else |
| 175 | return ntohs(serv->s_port); /* Found port (network byte order) by name */ |
| 176 | } |
| 177 | |
| 178 | // CommunicatingSocket Code |
| 179 |
nothing calls this directly
no outgoing calls
no test coverage detected