Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [APPL:DarwinDev] Re: My IP Address



On Tue, Nov 30, 2004 at 08:58:42PM +0000, Mark Gilbert scratched on the wall:

> So, first of all, I would like to have a status window in my app's 
> GUI which tells a local user which address they need to enter 
> remotely to control the app (without having to look elsewhere in the 
> computer to find it).

  That's a really good reason, although I might try to probe for the
  hostname, rather than just the IP address.  If a machine has multiple
  interfaces (== multiple IP addresses) things can get complex.

> Also, I am creating (in C) an HTML web page with a 'refresh' line, to 
> make the page automatically reload every 2 seconds (to generate a 
> live update of status). In order to do that I have to code my own IP 
> address into the HTML which I return to the client.

  If you just want the system to reload the same page, you don't need
  any URL.  Just say "Refresh: 2" or whatever, and it will reload the
  same URL.

  If you must use a different URL, you can usually grab the hostname
  from the "Host:" header in the HTTP 1.1 request.  That's kind of
  cheating, but it would likely work well.  Failing that, use the
  hostname.

  Two seconds is a bit quick, BTW, especially on a browser like Safari
  that delays the page rendering on downloads.

   -j

-- 
                     Jay A. Kreibich | Comm. Technologies, R&D
                        email@hidden | Campus IT & Edu. Svcs.
          <http://www.uiuc.edu/~jak> | University of Illinois at U/C
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: My IP Address (From: Mark Gilbert <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.