In Unix, all is a file, did you try to look inside the /proc/net directory to find your local IP ? Then, [text] can be used to load a specific file. ++
Jack
Le 17/12/2017 à 14:59, Roman Haefeli a écrit :
On Son, 2017-12-17 at 10:48 +0000, Andy Farnell wrote:
If the server is brokering the traffic then you never need to know the private network addresses as NAT will map them to public port numbers and the router will map the returned packets back to local addresses.
But I guess you want to use the server to do peer discovery and then having the two clients communicate directly.
Exactly, that's the idea.
Aren't there some more genral network utility objects in Pd?
Yes, iemnet comes with [tcpclient] and [udpclient], which accept and output bytes. They're pretty raw and probably close to your idea of a [sock] object. However, they don't output all properties of the current socket.
What I wish to be able to do is done in python like this:
#!/usr/bin/python import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 53)) print(s.getsockname()[0]) s.close()
In my wishes we would have: [tcpdump] and [hping], one to dump traffic, maybe in hex
All networking objects, including the ones from vanilla, are able to deal with bytes represented as numbers. I think that's far more versatile in Pd to use than hex.
to avoid Pd's fussiness about control characters, and one to craft any and all packets according to a template sent in a prior message.
And to get really serious about Pd as a network utility how about [sock], an object to be set up as a raw socket?
I think we're pretty well served with what we have already. What use cases do you have in mind that aren't covered yet?
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list