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

Re: Determine My IP Address


  • Subject: Re: Determine My IP Address
  • From: Quinn <email@hidden>
  • Date: Mon, 24 Apr 2006 10:43:16 +0100

At 20:34 -0700 23/4/06, Duane Murphy wrote:
Unfortunately, it's part of a specification that has these requirements.
This is a specification agreed upon by a large consortium that is not
about to change this now.

UPnP perhaps? (-:

How do you send the IP address to the remote machine? If you send it via UDP, the best solution is for you to connect the UDP socket to that address. This will force that socket to bind to a particular interface (based on the routing tables at that point in time), and getsockname will return its IP address. This may not work (a good outgoing path for UDP does not imply a good return path), but it probably will.

If you send the IP address to the remote host via TCP, you're golden. Open a TCP connection, then call getsockname on that socket, then assemble and send your data. This is more-or-less [1] guaranteed to work, because the TCP connection won't open unless there's a valid return path to that IP address.

[1] Well, there are always circumstances where things like this fail. If there's a NAT between you and the remote host, for example. Or if the firewall is blocking incoming connections to your server port. Still, it's a good place to start.

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Determine My IP Address
      • From: Les Vogel <email@hidden>
    • Re: Determine My IP Address
      • From: "Duane Murphy" <email@hidden>
References: 
 >How to get client IP address assigned by Cisco VPN client (From: Martin Bestmann <email@hidden>)
 >Re: How to get client IP address assigned by Cisco VPN client (From: Josh Graessley <email@hidden>)
 >Re: How to get client IP address assigned by Cisco VPN client (From: "Duane Murphy" <email@hidden>)
 >Re: How to get client IP address assigned by Cisco VPN client (From: "Justin C. Walker" <email@hidden>)
 >Determine My IP Address (was Re: How to get client IP address assigned by Cisco VPN client) (From: "Duane Murphy" <email@hidden>)
 >Re: Determine My IP Address (From: Peter Bierman <email@hidden>)
 >Re: Determine My IP Address (From: "Duane Murphy" <email@hidden>)

  • Prev by Date: Re: Determine My IP Address
  • Next by Date: Re: Determine My IP Address
  • Previous by thread: Re: Determine My IP Address
  • Next by thread: Re: Determine My IP Address
  • Index(es):
    • Date
    • Thread