gethotbyname error continued

Derek Atkins warlord at MIT.EDU
Tue Jun 18 15:02:31 EDT 2002


Are you sure you're not hitting the gethostbyaddr() calls?
Also, I think the suggestion was to 'sethostent(1)', not (0).

-derek

"Frank Ramsay" <fjramsay1234 at hotmail.com> writes:

> >   sethostent(0);
> >   //	 Detect if we should call gethostbyname() or gethostbyaddr()
> >   if (isalpha(server_name[0])) {   /* server address is a name */
> >     hp = gethostbyname(server_name);
> >   } else  { /* Convert nnn.nnn address to a usable one */
> >     addr = inet_addr(server_name);
> >     hp = gethostbyaddr((char *)&addr,4,AF_INET);
> >     hp = gethostbyaddr((char *)&addr,5,AF_INET);
> >   }
> >   endhostent();

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the Discuss mailing list