William M Perry writes:
William> Kyle Jones <kyle_jones(a)wonderworks.com> writes:
> Before we wade into this morass, a question needs to be answered.
Is this
> worth doing? My opinion so far is that, no, it isn't.
Actually, I don't think so either. At a first glance, I had the idea
of taking benefit from the call to gethostbyname. If this had been sufficient,
it would have cost almost nothing to add this feature in the core of XEmacs.
But I wasn't not sure and that's what I asked.
William> You should create a socket, connect to the endpoint, and then do a
William> getsockname(). This will allow things like socks or remote-winsock
William> under windows to give you the correct information to work through the
William> proxy.
Ah yes. I've heard about this technique recently.
William> Didier, why do you want this information to begin with?
Actually, I'm writing a new version of mchat, that I hope will be
ready before 21.0 is out (as the first one was really nothing else than a
prototype to illustrate the feature). I wanted to retrieve /one/ IP address of
the machine to build a unique identifier for each member of the multicast
group. This raised the more general question that I submitted to the list.
With loadable modules, I guess we will be able to add stuff like the
technique you describe to each package needing it. For now, I think the best
solution is to let people custom-ize the name of a program to call in order to
get what I need.
Here, we have a program called `nsl'. It just returns one IP address
for the machine name you give as argv[1]. Is it widely known ?
--
/ / _ _ Didier Verna
http://www.inf.enst.fr/~verna/
- / / - / / /_/ / E.N.S.T. INF C201.1 mailto:vernaļ¼ inf.enst.fr
/_/ / /_/ / /__ / 46 rue Barrault Tel. (33) 01 45 81 73 46
75634 Paris cedex 13 Fax. (33) 01 45 81 31 19