Xinne / osc4py3

31 stars 6 forks source link

osc_terminate() doesn't work #2

Open JoeFirmament opened 6 years ago

JoeFirmament commented 6 years ago

I am not sure that function osc_terminate() can release resources (communications, threads…). after execute osc_terminate() , osc server still receive msg from client. I have tested some code as below:

osc_startup() osc_udp_client("127.0.0.1", 2781, "aclientname") osc_terminate() osc_startup() osc_udp_client("127.0.0.1", 2781, "aclientname")

I got an error : ValueError: OSC dispatcher name 'global' already used

daylanKifky commented 6 years ago

I had a similar error. It seems like osc_terminate() is doing its job, but partially. Is releasing most of the resources, but not deleting a "channel" that is created when a client or server is initialized. As a workaround I call something like:

from osc4py3 import oscchannel as osch
#... code...
osch.get_channel("aclientname").terminate()

perhaps this would also work:

osch.terminate_all_channels()

I'm now having another issues like #4, but I'm not sure if anyone is maintaining this library.

lpointal commented 6 years ago

I added a call to terminate_all_channels() in the three terminate() functions, and built 1.0.8 version uploaded on PyPI. Note: this is done in the sourcesup hosted repository: https://sourcesup.renater.fr/scm/viewvc.php?root=osc4py3

Remark: the whole system is not intended to be terminated and restarted (osc_startup() and osc_terminate() are normally once call functions).

JoeFirmament commented 6 years ago

@lpointal Thank you for ur reply. osc4py3 is really a great lib, helps me a lot.