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