hi list i need the ip of my computer to do a netsendconnection as client to a server (other computer with pd patch). so i want to send my ip to the server that it is able to connect back to my. is there a method for the client patch to get its own ip . .. ore exists a get_my_Ip external ore somthing . . .? ..nos
Hi,
I use the enclosed shell script. For this to work you will need the following:
Copy the attached script "ip_num.sh" somewhere, where it's seen by the shell (like /usr/local/bin). This script uses grep to find the relevant line in the ifconfig output. For me the keyword is P-T-P as I'm on a dialup network. Adjust to your situation. If you can invoke the script from a console and it returns the ip number, you should be set with the attached pd patch.
-- Orm
Am 30. Januar 2004, 11:35 Uhr (+0100) schrieb noskule:
hi list i need the ip of my computer to do a netsendconnection as client to a server (other computer with pd patch). so i want to send my ip to the server that it is able to connect back to my. is there a method for the client patch to get its own ip . .. ore exists a get_my_Ip external ore somthing . . .? ..nos
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
for Windows it is "ipconfig" or (in older version, like W95 "winipcfg"). M.
- the "ifconfig" command to work for the user owning the pd process
- the "shell" external
i need the ip of my computer to do a netsendconnection as client to a server (other computer with pd patch). so i want to send my ip to the server that it is able to connect back to my. is there a method for the client patch to get its own ip . .. ore exists a get_my_Ip external ore somthing . . .? ..nos
Am 30. Januar 2004, 14:05 Uhr (+0100) schrieb marius schebella:
for Windows it is "ipconfig" or (in older version, like W95 "winipcfg"). M.
I wasn't aware that it could be on a windows machine. In that case you'd also need "grep" and "sed". Maybe someone knows their respective names on windows.
-- Orm
On Friday, Jan 30, 2004, at 08:20 America/New_York, Orm Finnendahl
wrote:
Am 30. Januar 2004, 14:05 Uhr (+0100) schrieb marius schebella:
for Windows it is "ipconfig" or (in older version, like W95
"winipcfg"). M.I wasn't aware that it could be on a windows machine. In that case you'd also need "grep" and "sed". Maybe someone knows their respective names on windows.
I would highly recommend using Olaf's netclient/netserver from Maxlib.
It'll give you this info quite easily and save a ton of scripting time.
I tried the scripting route and it was going to be a regex-o-rama, to
the point where I was thinking of writing a Pd object just for getting
the machine's IP. Then I figured out how to do it better with
netclient/netserver.
Anyway, you can get grep and sed for Windows from Cygwin:
http://cygwin.com
.hc
-- Orm
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
"Information wants to be free." -Stewart Brand
On Fri, Jan 30, 2004 at 11:54:16AM +0100, Orm Finnendahl wrote:
Copy the attached script "ip_num.sh" somewhere, ...
My version of the script (for Mandrake), with the interface name as an argument.
#!/bin/sh
ifconfig $1 | grep 'inet adr:'
| sed -e 's/ +inet adr:([0-9|.]+).*$/\1/g'
For example: ip_num.sh eth0
-- Marc
On Friday, Jan 30, 2004, at 19:22 America/New_York, Marc Lavallée wrote:
On Fri, Jan 30, 2004 at 11:54:16AM +0100, Orm Finnendahl wrote:
Copy the attached script "ip_num.sh" somewhere, ...
My version of the script (for Mandrake), with the interface name as an argument.
#!/bin/sh ifconfig $1 | grep 'inet adr:'
| sed -e 's/ +inet adr:([0-9|.]+).*$/\1/g'
For example: ip_num.sh eth0
Now for the real challenge: write a script that works on all of the
platforms that Pd does. ;)
.hc ________________________________________________________________________ ____
Using ReBirth is like trying to play an 808 with a long stick. -David Zicarelli
. .thanks for the replys . . .t did try several methods . . ..and found out, that, for my thing the netserver and netclient of the maxlib works perfect: bidirectional, unix, windows .. . .so the same patch for every system nos
Hans-Christoph Steiner wrote:
On Friday, Jan 30, 2004, at 19:22 America/New_York, Marc Lavallée wrote:
On Fri, Jan 30, 2004 at 11:54:16AM +0100, Orm Finnendahl wrote:
Copy the attached script "ip_num.sh" somewhere, ...
My version of the script (for Mandrake), with the interface name as an argument.
#!/bin/sh ifconfig $1 | grep 'inet adr:'
| sed -e 's/ +inet adr:([0-9|.]+).*$/\1/g'
For example: ip_num.sh eth0
Now for the real challenge: write a script that works on all of the
platforms that Pd does. ;).hc ________________________________________________________________________ ____
Using ReBirth is like trying to play an 808 with a long stick. -David Zicarelli
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
On Mon, Feb 02, 2004 at 01:25:56AM -0600, Eric Skogen wrote:
Now for the real challenge: write a script that works on all of
the platforms that Pd does. ;)
maybe use thomas grill's python extern and something like: |gethostbyname(gethostname()) ?|
This would only give the ip address of the computer, not the ip address of a specific interface. On my laptop I can use four physical interfaces (eth0, eth1, wlan0 and ppp0), and its hostname is tied to the local address (127.0.0.1) because my laptop is not always connected to the Internet.
The way to get the different ip addresses is to use specific utilities that depends on the operating system; on the Windows platform, there's ipconfig and netsh, but their output are not consistent and also localized, which makes things more difficult.
So this is a case where a cross-platform external is a better choice than a script. (The best choice being to not use Windows at all).
-- Marc
noskule wrote:
hi list i need the ip of my computer to do a netsendconnection as client to a server (other computer with pd patch). so i want to send my ip to the server that it is able to connect back to my. is there a method for the client patch to get its own ip . .. ore exists a get_my_Ip external ore somthing . . .?
you could use netserver and netclient from maxlib instead since they provide bidirectional communication. You thus only need to know the IP of the server and once the connection is made (by the client) the server can send data to the client.
get it at http://www.akustische-kunst.org/puredata/maxlib/
Olaf
Nos,
Take a look at the [netrec] object in Maxlib. It'll spit out the IP of a computer that connects to it. That way your server knows the IP of the client.
David . . David McCallum . Music wants to be free . http://sintheta.org .
noskule wrote:
hi list i need the ip of my computer to do a netsendconnection as client to a server (other computer with pd patch). so i want to send my ip to the server that it is able to connect back to my. is there a method for the client patch to get its own ip . .. ore exists a get_my_Ip external ore somthing . . .? ..nos