Re: How to get my IP Address ?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Mozilla Thunderbird 0.9 (Macintosh/20041103) Jerry Pendergraft wrote: Not sure I completely understand your situtation, but you probably don't need to know your own ip address. If you send out a packet to another machine, that packet will contain a source address which is your address. Such address is put in by the hardware and handles the case of your machine having multiple interfaces. The software on the other machine will then use the address in the packet to reply. If you look in that reply packet the source will be the peer and the destination will be you. The problem with the question is: if the client managed to connect to the web server, why does it need to ask for an address? A cgi-bin to figure out a local address to send back to the client that's already connected to it is somewhat pointless. Now, the web server may direct traffic to a different host. But no amount of looking up local interfaces is going to help with this, nor do I think this is what the OP wondered about. But in general, what I would do is return a name where the service can be found; the name is resolved through name services by the client into a list of addresses. The addresses are tried in order to reach the server. This permits DNS round-robin, reverse NAT and port forwarding, multihoming, redirection, etc, to all just magically work. A server in a DHCP environment may need dynamic DNS or equivalent. For more symmetric peer LAN applications there's tons of discovery protocols out there (including Rendezvous), which is what I think Jerry is reaching for above. But this leaves out the role of the web service: SMIL? Generic XML data exchange vehicle? Session management? Load balancing? Edge redirection? Ticketing and admission? Or just a starting point? IMO more info is needed, and if there isn't more info it's time to go back to the drawing board and rethink. :) _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jan Brittenson