Hi Pd-devs,
I have one problem with my flashserver external. It uses the sys_addpollfn() and friends from m_imp.h. Everything works fine with Flash clients connecting & disconnecting or even crashing!
But whenever a client gets lost because the network connection gets interrupted (unplugged cable for example) flashserver does not recognise this. Neither does Pd notify flashserver nor does send() return an error (because data seems to be written in a buffer _succesfully_). Is there any way to figure out if send() is really sending or just copying data into that buffer in the hope of getting rid of it later? I have tried select() but it always returns that the socket is writeable....
any help very appreciated since web connections seem to disconnect quite often which hangs Pd at the moment...
Olaf
Maybe if you call send with the MSG_DONTWAIT flag ?
Just a guess, haven't tried it.
Guenter
On Wed, 16 Apr 2003, Olaf Matthes wrote:
Hi Pd-devs,
I have one problem with my flashserver external. It uses the sys_addpollfn() and friends from m_imp.h. Everything works fine with Flash clients connecting & disconnecting or even crashing!
But whenever a client gets lost because the network connection gets interrupted (unplugged cable for example) flashserver does not recognise this. Neither does Pd notify flashserver nor does send() return an error (because data seems to be written in a buffer _succesfully_). Is there any way to figure out if send() is really sending or just copying data into that buffer in the hope of getting rid of it later? I have tried select() but it always returns that the socket is writeable....
any help very appreciated since web connections seem to disconnect quite often which hangs Pd at the moment...
Olaf
PD-dev mailing list PD-dev@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev
Hi again,
it works now on Windows: after a while (when the send buffer is full) send() returns 0 and flashserver closes the socket.
However, on Linux flashserver seems to call sys_exithandler() from s_inter.c. It then prints "Pd: signal 13" to the console window and Pd closes. I added "sigaction(SIGPIPE, &sa, (struct sigaction *)NULL);" to flashserver's new routine (not really knowing what I was doing, just guessing) and now I get "Pd: signal 2".
Can somebody please explain to me what these numbers mean and (if possible) what I have to add to flashserver to prevent it from calling Pd's sys_exithandler()....?!
thanks, Olaf
Hi Olaf,
On Linux you get SIGPIPE if the other end breaks the connection. In pd this signal is handled by sys_exihandler. In order to get rid of the signal you can set MSG_NOSIGNAL upon sending, I think.
Greetings,
Guenter
------------------------------------------------------------------------ Music Technology Group - UPF, Barcelona http://www.iua.upf.es/mtg/eng/ AGNULA - A GNU Linux Audio distribution <www.agnula.org> DeMuDi - Debian Multimedia Distribution <www.demudi.org>
On Mon, 21 Apr 2003, Olaf Matthes wrote:
Hi again,
it works now on Windows: after a while (when the send buffer is full) send() returns 0 and flashserver closes the socket.
However, on Linux flashserver seems to call sys_exithandler() from s_inter.c. It then prints "Pd: signal 13" to the console window and Pd closes. I added "sigaction(SIGPIPE, &sa, (struct sigaction *)NULL);" to flashserver's new routine (not really knowing what I was doing, just guessing) and now I get "Pd: signal 2".
Can somebody please explain to me what these numbers mean and (if possible) what I have to add to flashserver to prevent it from calling Pd's sys_exithandler()....?!
thanks, Olaf
PD-dev mailing list PD-dev@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-dev