Re: [LAD] python-osc udp_client.UDPClient() - How do I figure out the reply-to IP?

From: Christopher Arndt <chris@email-addr-hidden>
Date: Wed Jul 06 2016 - 09:59:01 EEST

Am 06.07.2016 um 01:38 schrieb Kevin Cole:
> In pythonosc (https://pypi.python.org/pypi/python-osc) after
> connecting with udp_client.UDPClient(...) from a "client", how can I
> detect the IP to respond to in the "server"?

Normally, with UDP servers, you'd use socket.recvfrom() to read the data
from the client and get its address.

https://docs.python.org/3/library/socket.html#socket.socket.recvfrom

But it doesn't seem like pythonosc supplies the client's address to the
dispatcher.

>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.

It's not uncommon for OSC software, that you have to specify client (a)
address(es) in the server as well, since OSC, commonly using UDP as a
transport, is only uni-directional, so to get bi-directional
communication, every participant in an OSC communication has to be a
server and a client.

If you don't need a pure-Python library, I'd look at python-liblo.

Chris

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Wed Jul 6 12:15:01 2016

This archive was generated by hypermail 2.1.8 : Wed Jul 06 2016 - 12:15:01 EEST