- struct servent *servent;
-
- if (!name || !strlen(name))
- return FALSE;
-
- if (!isdigit(*name)) {
- if ((servent = getservbyname((char*) name, "tcp")) == 0)
- return FALSE;
- } else {
- if ((servent = getservbyport(atoi(name), "tcp")) == 0) {
- m_addr->sin_port = htons(atoi(name));
- return TRUE;
- }
- }
-
- m_addr->sin_port = servent->s_port;
- return TRUE;