Open titola opened 8 years ago
It's probably correct. I'll wait til tomorrow before I apply. Just put it into the back of the head in the meanwhile.
I don't feel too safe about this. I don't want to apply it to the libpds repository, in case it causes something, and I forget about it. I'll see what Miller says first. Perhaps you can make a pull request to the libpds repository instead? https://github.com/kmatheussen/libpd
Don't worry, I think a patch for pd is enough.
The change is safe for me. Probably the soap opera with sys_startgui is the follow: the socket was closed after the connection but not for the children. It was a bug and they "fixed" it by using a #ifdef around sys_closesocket. But that's only a workaround. Under the hood the child tries to listen but it silently fails because the parent continues to listen on the same port. The patch is the correct fix where the socket is closed for all (parent and children). I don't see side effects because the correct behaviour of sys_startgui is
- listen for a connection
- accept and connect
- return (without other useless listening)
Besides, the listening after sys_startgui is without control because the socket "xsock" is local.
It is a problem in pd (patch submitted).
Example with radium:
The patch for pd is here:
https://sourceforge.net/p/pure-data/patches/577/
and for radium: