<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Il 06/07/2016 01:38, Kevin Cole ha scritto:<br>
<blockquote
cite="mid:CA+pvXRcNAr=0DKxyzL-_my9sAKGRu1_OenqxVNYJ2y1CVOugPw@mail.gmail.com"
type="cite">
<pre wrap="">Hi,
In pythonosc (<a class="moz-txt-link-freetext" href="https://pypi.python.org/pypi/python-osc">https://pypi.python.org/pypi/python-osc</a>) after
connecting with udp_client.UDPClient(...) from a "client", how can I
detect the IP to respond to in the "server"?
If I explicitly supply the return IP in the server's
udp_client.UDPClient(...) call it works. But I want the server to
listen for an incoming connection or call on a particular port and
figure out who sent it and reply to that IP.
I have no network-fu.
Thanx!
--
@ubuntourist
_______________________________________________
Linux-audio-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Linux-audio-dev@lists.linuxaudio.org">Linux-audio-dev@lists.linuxaudio.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxaudio.org/listinfo/linux-audio-dev">http://lists.linuxaudio.org/listinfo/linux-audio-dev</a>
</pre>
</blockquote>
<br>
Hi,<br>
<br>
Looking at python-os "osc-server.py" code, I've noticed that the
client address (IP, Port) is left, when dispatching UDP request,<br>
you can either use a custom version (<a
href="http://pastebin.com/g7WBmHya">like this</a>), were the
callbacks receive the request address (in the example, as second
argument),<br>
or if you can freely decide what to send to the server, the clients
can send their address into the requests, like this:<br>
<br>
msg = osc_message_builder.OscMessageBuilder(address="/MyAddress")<br>
msg.add_arg("Value")<br>
msg.add_arg("IP_ADDRESS") # replace with the client address using
for example "
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
socket.gethostname()"<br>
msg = msg.build()<br>
client.send(msg)<br>
</body>
</html>