• 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: + (NSHost*) currentHost?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: + (NSHost*) currentHost?


  • Subject: Re: + (NSHost*) currentHost?
  • From: Chris Hanson <email@hidden>
  • Date: Wed, 22 Oct 2003 13:33:26 -0500

On Oct 21, 2003, at 12:53 PM, petite_abeille wrote:
How do people deal with changing local host addresses?

There's an Apple Tech Note on living in a multi-homed environment. I can't give the number off the top of my head, but it describes what you need to do.

The short version is "Don't bind to a particular local address." That is, if you're listening for connections, be sure you're listening on INADDR_ANY.

And short of pooling +currentHost, what would be a "reasonable" way to know that the local address has changed in the first place?

SystemConfiguration.framework (SCF) includes notifications that are broadcast whenever a key changes. Since SCF manages network configurations, that's what you want to use.

You can play around with /usr/sbin/scutil to see how this works.

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Mac OS X Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: + (NSHost*) currentHost?
      • From: petite_abeille <email@hidden>
References: 
 >+ (NSHost*) currentHost? (From: petite_abeille <email@hidden>)

  • Prev by Date: Re: Way to get IB to always be aware of my constantly used classes?
  • Next by Date: Re: + (NSHost*) currentHost?
  • Previous by thread: + (NSHost*) currentHost?
  • Next by thread: Re: + (NSHost*) currentHost?
  • Index(es):
    • Date
    • Thread