Re: IP of a connected Mac
Re: IP of a connected Mac
- Subject: Re: IP of a connected Mac
- From: Joshua Graessley <email@hidden>
- Date: Fri, 3 Jan 2003 14:04:46 -0800
The easiest way is probably to call getifaddrs and iterate through all
of the addresses.
As always, be sure you know what you're doing. Ideally, your
application shouldn't know too much about what address it is using.
Addresses change from time to time. In addition, you shouldn't pass IP
addresses around in a protocol. Doing so leads to many problems with
devices such as NATs and, if not handled correctly, may not work
correctly on a multi-homed host. Quinn has written an excellent
technote about living in a dynamic environment that covers some issues.
-josh
On Friday, January 3, 2003, at 02:19 AM, Arthur VIGAN wrote:
Hi,
how can I get the IP address of the computer with Cocoa when the user
is connected to the Internet?
Thanks in advance,
Arthur
_______________________________________________
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.
_______________________________________________
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.