delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/09/04:52:17

Date: Mon, 9 Jun 1997 16:48:22 +0800 (GMT)
From: Orlando Andico <orly AT gibson DOT eee DOT upd DOT edu DOT ph>
To: "Jason M. Daniels" <bd733 AT rgfn DOT epcc DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: TCP/IP, what is my IP address?
In-Reply-To: <5ng5rt$eo6@news.epcc.edu>
Message-ID: <Pine.SGI.3.93.970609164704.23123B-100000@gibson.eee.upd.edu.ph>
MIME-Version: 1.0

> Orlando Andico (orly AT gibson DOT eee DOT upd DOT edu DOT ph) wrote:
> > Uhm. If you're using UNIX, you can do something like this:
> 
> <snip>
> 
> >  tmpentry = gethostbyname ("localhost");
> 
> <snip>
> 
> Won't this always return 127.0.0.1, though?

Hmm. That's a possibility. In which case, it's UNIX-flavor-dependent. I
guess you could use gethostname(2) to get the hostname, then do the stuff
I've mentioned previously. 

-----------------------------------------------------------------------
Orlando Alcantara Andico
WWW:   http://www2.mozcom.com/~orly/           Email:   orly AT mozcom DOT com
ICBM:  14 deg. 30' N, 120 deg. 59' E           POTS:    (+632) 932-2385

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019