Hi guys! i am trying to connect Pure Data and Processing by OSC. Yesterday when i did the conection between the two programs it was succesfull. But today, i get this problem:
i am working with the port 11112, If i open pd first ,and then run the processing sketch i get this message of processing:
"ERROR @ UdpServer.start() IOException, couldnt create new DatagramSocket @ port 11112 java.net.BindException: Address already in use: Cannot bind"
If i open processing first and then pure data, processing listening the port 11112 without any problem,but the error in pure data that i get is:
" dumpOSC 11112
... couldn't create",
if, for example i write dumpOSC 11111 (and processing stills in 11112), the dumpOSC object
is created normally.
I think is a UDP problem but i cant find the solution anywhere, Please, does anybody know what the problem is? THANKS!!
-
PD-PROCESSING with OSC problems
-
@julibla2 Not easy to tell. I will start at the end.
If you cannot create [dumpOSC 11112] it is because Pd is already listening to the same port.
Do you have 2 or more of them in your patch?
You can only have one [dumpOSC 11112] in your patch.If you are only using [dumpOSC] in Pd then it looks like it is not Pd causing the problem for Processing.
Unless you are also sending back to Processing from Pd using [udpsend]?If you are doing 2 way communication then you need 2 different ports.......
1 port to send from processing to Pd
2 port to send from Pd to Processing.The server...... in Pd [udpsend] needs to open its socket (broadcast that it is on the network)..... so that Processing can connect and listen to that socket. I do not know how Processing does that.
The client........ in Pd [dumpOSC] needs the server in Processing to broadcast its socket so that [dumpOSC] can connect.
If you open Pd first and then Processing complains then either you have created [udpsend] on port 11112 already..... so Processing cannot create the socket, or Processing has already opened it, or some other program has already opened it.
It is used by "ACR/NEMA Digital Imaging and Communications in Medicine (DICOM)"
If you recognize that organization then that would be your problem.
Very unlikely though.Another thought. It could be, if you are restarting the programs very quickly after shutting them down, that the sockets have not been released after previous use. You could Google "TIME_WAIT" and "SO_REUSEADDR " for more info.
Usually the sockets are locked out for 30 to 120 seconds...... https://stackoverflow.com/questions/3229860/what-is-the-meaning-of-so-reuseaddr-setsockopt-option-linux/3233022#3233022
[udpreceive] sets SO_REUSEADDR so could be a better choice than [dumpOSC] which does not.
David.