Re: local host IP address on X
Re: local host IP address on X
- Subject: Re: local host IP address on X
- From: Kevin Parichan <email@hidden>
- Date: Tue, 16 Jul 2002 23:05:17 -0700
>
The problem here is that these standard sockets calls aren't really
>
well suited to a dynamic TCP/IP environment. Because Mac OS X has
>
lots of code that assumes that these calls do something meaningful,
>
they've been hardwired to always return the loopback address. That
>
way UNIX programs that assume a single fixed IP address continue to
>
limp along.
>
>
The best fix is to use the System Configuration framework APIs to
>
build an IP address list, and also to be notified when that list
>
changes. Alternatively, you can use the get_ifi_info routine (on
>
page 434 of Stevens) to get the full list of IP addresses and choose
>
amongst them.
The product (a game) actually does have an interface for the user to
select a particular address if the machine has more than one. I'm also
only building one executable, loading routines from frameworks if
necessary. Even though it's overkill, I'm wondering if I should just use
OT in this particular case to build my list? The routines are available
via CFM and since the list is only built once, a performance hit would be
no big deal. The rest of the networking code would remain as-is (i.e.
socket-based).
=kp
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.