hostNameToAddress not working???

Mark Schonewille m.schonewille at economy-x-talk.com
Fri Feb 15 08:09:04 EST 2008


Hi Dave,

The hostaddresstoname and hostnametoaddress function work fine. My  
tiny cgi script on Memebot works fine too.

I bet your machine is connected to a local network using a router. It  
is also possible that you have additional gateways defined on your  
local machine, e.g. to facilitate Parallels.

If an IP number or address doesn't exist or is invalid, e.g. because  
it is of the form "Machine.local", the hostaddresstoname and  
hostnametoaddress functions may return empty. This is normal.

Perhaps, you are looking for:

put hostaddresstoname(url "http://xtalk.memebot.com/cgi-bin/ip.cgi")

Best regards,

Mark Schonewille

--

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Convert colours between different colour spaces with Color Converter.  
Download at http://economy-x-talk.com/cc.html



Op 15-feb-2008, om 12:53 heeft Dave het volgende geschreven:

> Hi All,
>
> I have the following function:
>
> ------------------------------------------------------------------
> --
> --  Get the LAN IP Address of this Machine
> --
> ------------------------------------------------------------------
> function IPMGetHostIPAddressLAN
>   local myHostIPAddress
>
>   put hostNameToAddress(the hostName) into myHostIPAddress
>   return myHostIPAddress
> end IPMGetHostIPAddressLAN
>
>
> This used to work fine and return the local LAN address of the  
> machine the Script is running on, I just tried it and now it just  
> returns empty.
>
> I originally cribbed this from Richmond's "Get IP Address" stack. I  
> download this again from rev online and it too fails. From this stack:
>
> on mouseUp
>   put "Public IP =" && url "http://xtalk.memebot.com/cgi-bin/ 
> ip.cgi" into line 1 of fld "F1"
>   put "Local IP =" && hostnametoaddress ("localhost") into line 2  
> of fld "F1"
>   put "LAN IP =" && hostnametoaddress(the hostname)  into line 3 of  
> fld "F1"
> end mouseUp
>
> When I run this I get "empty" as the LAN Address. The other two IP  
> address fields are filled in ok.
>
> Could anyone shed any light on why this has stopped working and how  
> I can obtain the LAN IP address?
>
> Thanks a lot
> All the Best
> Dave
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list