• 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: IP of a connected Mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >IP of a connected Mac (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: socket equivalent of OTCancelSynchronousCalls
  • Next by Date: Re: socket equivalent of OTCancelSynchronousCalls
  • Previous by thread: IP of a connected Mac
  • Next by thread: Re: IP of a connected Mac
  • Index(es):
    • Date
    • Thread