attwad / python-osc

Open Sound Control server and client in pure python
The Unlicense
517 stars 108 forks source link

Sending/Receiving example... #53

Closed robertobrambila closed 6 years ago

robertobrambila commented 6 years ago

Hello.

(please bear with me, as I'm a n00b.. as evidenced by the history :D)

I'm trying to setup a program that is always running and both sends and receives messages via OSC (I'm talking to and listening from TouchDesigner). So, from the provided examples, I'm trying to have both a client and server running. I'd like to be able to send a message via my client to TouchDesigner at any moment (say at a keypress), have TouchDesigner spit it back to me and be able to read it via my server.

Seems like my issue (from hacking together the two examples) is that my server code is blocking any attempts for sending (most likely because of: server.serve_forever()). What is the better way to approach this?

robertobrambila commented 6 years ago

Found the solution (threading) through the osc_server.py doc strings. Thank you.