Re: Getting IP Address
Re: Getting IP Address
- Subject: Re: Getting IP Address
- From: Scott Thompson <email@hidden>
- Date: Wed, 21 Jul 2004 20:49:11 -0500
On 20 Jul, 2004, at 10:07 PM, David Cornell wrote:
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
Hee hee he... the fe80::1 address is the "real IP" address. It just
happens to be the IPv6 address. The wave of the future!
Are you calling something like [[NSHost currentHost] addresses]? If so
then you should get the IPv4 address as part of that. One of them
should be a dotted string of numbers similar to the one you are looking
for.
Unfortuantely, your machine may have more than one IP address as
another poster mentioned. My laptop, for example, could have up to
three. One for Airport, one for the wired ethernet, and one for the
Bluetooth modem connection. I've never tried having all three up at
once (might be interesting though).
Scott
_______________________________________________
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.