• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: local host IP address on X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: local host IP address on X


  • Subject: Re: local host IP address on X
  • From: Allan Nathanson <email@hidden>
  • Date: Wed, 17 Jul 2002 07:42:19 -0400

On Wednesday, July 17, 2002, at 02:05 AM, Kevin Parichan wrote:

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).

Our networked computers are no longer bolted to the floor with an unchanging network configuration. How does your product behave if:

- someone starts up the game and then brings up their network link to the outside world?
- someone puts their laptop system to sleep in one location and wakes it up in another?

Fun stuff, eh?

- Allan
Core OS, Applications & Mobility
_______________________________________________
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.

References: 
 >Re: local host IP address on X (From: Kevin Parichan <email@hidden>)

  • Prev by Date: Re: local host IP address on X
  • Next by Date: Re: CFNetwork crash!
  • Previous by thread: Re: local host IP address on X
  • Next by thread: Re: local host IP address on X
  • Index(es):
    • Date
    • Thread