Public ip address

Alex Tweedly alex at tweedly.net
Sat Jul 24 19:41:46 EDT 2004


At 17:01 24/07/2004 -0600, Dar Scott wrote:


>On Jul 24, 2004, at 4:13 PM, Roger Amar wrote:
>
>>I can't find how to get with Revolution the ip address provided by the
>>ISP, to avoid the use of http://www.whatismyip  ?
>
>Here is another approach:
>
>function myIP
>   constant testIP = "1.0.0.1"  -- Any public IP should do. -- Dar
>   open datagram socket testIP
>   get hostAddress(testIP)
>   close socket testIP
>   return it
>end myIP
>
>Note that opening a datagram socket does not try to communicate with anything.
>
>This works on most platforms but not OS X.  It does work on OS X with 
>Revolution 2.5 beta, so there is a good chance this will worked with the 
>2.5 release.

I can only test it on Windows, but
    put hostNameToAddress("")
seems to do the right thing for me.

-- Alex.
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004


More information about the use-livecode mailing list