• 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: Getting IP Address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting IP Address


  • Subject: Re: Getting IP Address
  • From: Stephan Lichtenauer <email@hidden>
  • Date: Wed, 21 Jul 2004 10:38:49 +0200

Am 21.07.2004 um 07:07 schrieb David Cornell:

Hey, total newb here...

How do I get the dotted ip address of the currenthost, I'm currently using
NSHost but I get fe80::1. I need to get the real IP, such as 192.168.100.12
etc.

thanks in advance!
dave
_______________________________________________

Hi Dave,

fe80::1is a "real" IP address, so unless you *really* have a good reason to only show IPv4 addresses like 192.168.100.12, I think you shouldn't filter the NSHost output. Otherwise you unnecessarily break compatibility of your program with IPv6 networking.

Now If you nevertheless really want to do that, I also suggest you go the way that has already been proposed: Look only for addresses with "." in them.

Otherwise I suggest you leave it as it is, because OS X already automatically takes care of most of the IPv6 stuff as you can see (depending of course also on how low-level your program works), and you might want to check out the IPv6 Apple mailing list and a good IPv6 book...

Stephan
_______________________________________________
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: Getting IP Address
      • From: Stéphane Sudre <email@hidden>
References: 
 >Getting IP Address (From: "David Cornell" <email@hidden>)

  • Prev by Date: Video Card model name?
  • Next by Date: ByHost Preferences
  • Previous by thread: Re: Getting IP Address
  • Next by thread: Re: Getting IP Address
  • Index(es):
    • Date
    • Thread