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
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  guaranteed to
work, because the TCP connection won't open unless there's a valid
return path to that IP address.
 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.
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