Created
February 14, 2019 18:12
-
-
Save iani/bf1bae31b100716194db5fde065a7b0f to your computer and use it in GitHub Desktop.
nymphs - sketch of ip forwarding - first steps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Registry.put(\test, (corfu: 1, athens: 2)); | |
//: | |
Registry.at(\test); | |
//: | |
"hamachi list".unixCmd; | |
//: | |
var answer; | |
answer = "hamachi list".unixCmdGetStdOut; | |
answer.postln; | |
answer.split(Char.nl) do: { | line, num | postf("this is line number: %\n%\n", num, line) }; | |
answer.size; | |
//: | |
/* | |
* [magnetic-dance] capacity: 3/5, subscription type: Free, owner: budos (227-352-918) | |
this is line number: 1 | |
227-352-918 budos 25.0.0.0 alias: not set | |
this is line number: 2 | |
! 227-366-342 budos 25.0.0.0 alias: not set This address is also used by another peer | |
this is line number: 3 | |
* [magneticdancetest] capacity: 2/5, subscription type: Free, owner: budos (228-742-800) | |
this is line number: 4 | |
* 228-742-800 budos 25.80.47.40 alias: not set 2620:9b::1950:2f28 direct UDP 10.3.141.100:32822 | |
this is line number: 5 | |
-> 661 | |
*/ | |
// ================================================================ | |
// We hardwire the local address of the sending pi. | |
/* Note: If we need more than one pi in one space locally, then | |
one pi has to be the wifi server, and the other pi's must log in | |
to that pi-server and obtain their ip from it. | |
Note that the logical ID of the sending device is given | |
by the name of the message, not by the IP. | |
*/ | |
//:dummy prototype 1 - v.0 | |
var localpiIP; | |
localpiIP = "10.3.141.1"; | |
thisProcess.addOSCRecvFunc({ | ... args | | |
args.postln; | |
}) | |
//:dummy prototype 1 - v.1 | |
var localpiIP; | |
localpiIP = 168004865; // "10.3.141.1"; | |
thisProcess.addOSCRecvFunc({ | msg, time, ip | | |
ip.addr.postln; | |
if(ip.addr == localpiIP) { | |
postf("Received from local ip this: %\n", msg[..4]); | |
}{ | |
"not local???????".postln; | |
} | |
}) | |
//: | |
OSCFunc.trace(true); | |
NetAddr.localAddr.hostname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment