Is it possible to open/close OSC in processing?

Hi there, I am using oscP5 library to communicate from grasshopper to processing, but when the data is sent and saved, I’d like to close (and probably reopen) the OSC channel. is it possible? I tried with mousePressed() with a button, but not sure how to close OSC channel.

Try calling stop on your oscP5 object. That should do it.

Kf

Thanks! it sure has a function to stop!..
and I initiate it again to reopen?.

sorry for the stupid question…:sweat_smile:

I just got that info from looking at the source code. Stop is called everytime you exit your app as it is associated to the dispose method. In your case, you can use it to stop your connection. To restore the connection, you should use the same steps as creating one. I haven’t done that myself but it should work. Give it a try.

Kf

I did exactly what you’ve said and it works perfectly. Thanks!

1 Like