Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-26 Thread Dave

Hi,

Thanks a lot, that worked great, for anyone that is interested, here  
is a function to return the local IP address:



--
--
--  Get the Local IP Address of this Machine
--
--
function GetLocalHostIPAddress
  local myIPAddress
  local myHostAddress

  put 255.255.255.255:6000 into myIPAddress
  open datagram socket to myIPAddress
  put the hostAddress of myIPAddress into myHostAddress
  close  socket myIPAddress

  return myHostAddress
end GetLocalHostIPAddress


--
--
--  Test it on a Button
--
--
on mouseUp
 put GetLocalHostIPAddress()
end mouseUp


Thanks again
Dave

On 25 Oct 2006, at 20:41, Dar Scott wrote:



On Oct 25, 2006, at 7:09 AM, Dave wrote:

How can I get the IP address of the machine that a stack is  
running on?


Open a datagram socket to a legal IP address.  That does not have  
to be assigned.  Then get the hostAddress of that socket.  Then  
close it.  The hostAddress will be what you want.


If the machine has more than one IP address, the address will be  
the one that would be used in trying to make the connection.  For  
example, on a firewall, the machine might have both a public IP  
address for one adaptor and a private IP address for the LAN on  
another adaptor.  Also, a single Ethernet LAN might have more than  
one IP address assigned to an adaptor on a machine (I use this for  
addressing both my network and instruments that come with a fixed  
IP address).  And then there are dialups and VPNs and...


The cool part about the datagram method is that it is not  
intrusive.  It does not try to do anything on the net.


If you want the IP address of the default adaptor, try  
255.255.255.255.  This does not always work; I forgot the  
constraints.


This method would not work at one time on OS X, but that was fixed.

Dar

--
**
Dar Scott
Dar Scott Consulting  and  Dar's Lab
8637 Horacio Place NE
Albuquerque, NM 87111

Lab, office, home:  +1 505 299 9497
Fax:call above first
Skype:  ask

http://www.swcp.com/dsc
[EMAIL PROTECTED]

Computer programming
**


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Getting IP Address of Machine that is Currently Running the Stack

2006-10-26 Thread Richmond Mathewson
I have done the obvious thing:

I have lifted the scripts out of this recent thread
and combined them in a stack which I have just
uploaded to RevOnline:

IP Addresser

Credit IS given.

Love, Richmond



I have just read and signed the online petition:

   Hinge  Bracket

hosted on the web by PetitionOnline.com, the free online petition
service, at:

   http://www.PetitionOnline.com/HandB/

I personally agree with what this petition says, and I think you might
agree, too.  If you can spare a moment, please take a look, and 
consider signing yourself.

Richmond Mathewson


Send instant messages to your online friends http://uk.messenger.yahoo.com 
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread Dave

Hi All,

How can I get the IP address of the machine that a stack is running on?

Thanks a lot
All the Best
Dave

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread jbv


Dave,

I usually do that by sending a get URL request to a cgi script (Rev cgi
or php) that runs on a server and that returns the client IP.

JB


 Hi All,

 How can I get the IP address of the machine that a stack is running on?

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread Eric Chatonet

Hi Dave,

Here is an example that might be easier to use:

local lIPAddress -- local script variable
--
function GetIPAddress
  local tInternetConnected
  -
  put hostNameToAddress(www.runrev.com)  empty into  
tInternetConnected

  if tInternetConnected then
put empty into lIPAddress
open socket to www.runrev.com:443 with message SocketOpen
wait until lIPAddress  empty with messages
return lIPAddress
  else return Error: could not find an internet connection.
end GetIPAddress
--
on socketOpen
  put the hostAddress of www.runrev.com:443 into lIPAddress
  close socket www.runrev.com:443
end socketOpen

You will use this code easily:

put GetIPAddress() into tCurMachineIPAddress

Of course you may use another domain than www.runrev.com and another  
port than 443 as you like :-)
Have a look at hostNameToAddress, open socket,  close socket and  
hostAddress in the docs.


Best Regards from Paris,
Eric Chatonet

Le 25 oct. 06 à 16:06, jbv a écrit :


Dave,

I usually do that by sending a get URL request to a cgi script  
(Rev cgi

or php) that runs on a server and that returns the client IP.

JB



Hi All,

How can I get the IP address of the machine that a stack is  
running on?


 
--

http://www.sosmartsoftware.com/[EMAIL PROTECTED]/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread Mark Schonewille
There are several ways to get your IP address, depending on which  
address you need. One possibility is this one-liner:


  put char 1 to -9 of (last word of line ¬
  lineoffset(title,url http://www.whatismyip.com;) ¬
  of url http://www.whatismyip.com;)

Probably you want to split up this line, to get the url first and  
then the ip. Of course, it is much easier, if you have a good cgi  
available. I put one up at http://xtalk.memebot.com/cgi-bin/ip.cgi  
which returns nothing but your public ip address. You can use this  
URL as long as Memebot doesn't complain about bandwidth usage, but  
you should install a cgi on your own server if possible.


Use the following script to get the public IP address in Revolution:

  put url http://xtalk.memebot.com/cgi-bin/ip.cgi;

You can get your LAN IP address with the following script:

  put hostnametoaddress(the hostname)

and the local IP address of your machine with

  put hostnametoaddress(localhost)

Best,

Mark

--

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

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz


Op 25-okt-2006, om 15:09 heeft Dave het volgende geschreven:


Hi All,

How can I get the IP address of the machine that a stack is running  
on?


Thanks a lot
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread Luis

Or run a shell script and parse the output:

ifconfig on OS X and ipconfig in Windows.

Cheers,

Luis.


Mark Schonewille wrote:
There are several ways to get your IP address, depending on which 
address you need. One possibility is this one-liner:


  put char 1 to -9 of (last word of line ¬
  lineoffset(title,url http://www.whatismyip.com;) ¬
  of url http://www.whatismyip.com;)

Probably you want to split up this line, to get the url first and then 
the ip. Of course, it is much easier, if you have a good cgi available. 
I put one up at http://xtalk.memebot.com/cgi-bin/ip.cgi which returns 
nothing but your public ip address. You can use this URL as long as 
Memebot doesn't complain about bandwidth usage, but you should install a 
cgi on your own server if possible.


Use the following script to get the public IP address in Revolution:

  put url http://xtalk.memebot.com/cgi-bin/ip.cgi;

You can get your LAN IP address with the following script:

  put hostnametoaddress(the hostname)

and the local IP address of your machine with

  put hostnametoaddress(localhost)

Best,

Mark

--

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

Get your store on-line within minutes with Salery Web Store software. 
Download at http://www.salery.biz


Op 25-okt-2006, om 15:09 heeft Dave het volgende geschreven:


Hi All,

How can I get the IP address of the machine that a stack is running on?

Thanks a lot
All the Best
Dave


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread Luis



Mark Schonewille wrote:
There are several ways to get your IP address, depending on which 
address you need. One possibility is this one-liner:


  put char 1 to -9 of (last word of line ¬
  lineoffset(title,url http://www.whatismyip.com;) ¬
  of url http://www.whatismyip.com;)



This will get you the external IP, which may not be the IP address of 
the workstation but rather the IP address of the router.


Cheers,

Luis.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread Mark Schonewille
Luis, that's why I explicitly distinguished public, LAN and local  
(machine) IP addresses.


--

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

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz


Op 25-okt-2006, om 16:59 heeft Luis het volgende geschreven:




Mark Schonewille wrote:
There are several ways to get your IP address, depending on which  
address you need. One possibility is this one-liner:

  put char 1 to -9 of (last word of line ¬
  lineoffset(title,url http://www.whatismyip.com;) ¬
  of url http://www.whatismyip.com;)


This will get you the external IP, which may not be the IP address  
of the workstation but rather the IP address of the router.


Cheers,

Luis.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Getting IP Address of Machine that is Currently Running the Stack

2006-10-25 Thread Dar Scott


On Oct 25, 2006, at 7:09 AM, Dave wrote:

How can I get the IP address of the machine that a stack is running  
on?


Open a datagram socket to a legal IP address.  That does not have to  
be assigned.  Then get the hostAddress of that socket.  Then close  
it.  The hostAddress will be what you want.


If the machine has more than one IP address, the address will be the  
one that would be used in trying to make the connection.  For  
example, on a firewall, the machine might have both a public IP  
address for one adaptor and a private IP address for the LAN on  
another adaptor.  Also, a single Ethernet LAN might have more than  
one IP address assigned to an adaptor on a machine (I use this for  
addressing both my network and instruments that come with a fixed IP  
address).  And then there are dialups and VPNs and...


The cool part about the datagram method is that it is not intrusive.   
It does not try to do anything on the net.


If you want the IP address of the default adaptor, try  
255.255.255.255.  This does not always work; I forgot the constraints.


This method would not work at one time on OS X, but that was fixed.

Dar

--
**
Dar Scott
Dar Scott Consulting  and  Dar's Lab
8637 Horacio Place NE
Albuquerque, NM 87111

Lab, office, home:  +1 505 299 9497
Fax:call above first
Skype:  ask

http://www.swcp.com/dsc
[EMAIL PROTECTED]

Computer programming
**


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution