Re: Getting IP Address
Re: Getting IP Address
- Subject: Re: Getting IP Address
- From: Stephan Lichtenauer <email@hidden>
- Date: Wed, 21 Jul 2004 13:22:21 +0200
Am 21.07.2004 um 12:38 schrieb Stiphane Sudre:
On Jul 21, 2004, at 10:38 AM, Stephan Lichtenauer wrote:
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.
An IPv6 address can be written with '.' into it.
http://www.faqs.org/rfcs/rfc3513.html
So the solution is more to avoid any address with ':'.
Yes, you are right, I forgot about that one... But nevertheless I think
my main point remains valid: I would try to not filter out the IPv6
addresses except for very good reasons.
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.