[PD] pd and tcp: what to do against crashes?

Roman Haefeli reduzierer at yahoo.de
Mon Feb 23 23:43:53 CET 2009

On Mon, 2009-02-23 at 21:03 +0000, Martin Peach wrote:
> Roman Haefeli wrote:
> > > >with the newest [tcpserver] i cannot send messages to clients anymore. 
> >i
> > > >tried both, 'send <socketnumber>' and 'client <number>'. whenever
> > > >[tcpserver] receives such a message, pd is blocked for about a second
> > > >and the i get in the console:
> > > >
> > > >tcpserver_send_buf: client 1 not writeable
> > > >
> > >
> > > Are you sending a lot of data? That should only happen if you send more 
> >than
> > > a buffer, whatever that is, only the system knows. It blocks for exactly 
> >one
> > > second if the buffer is full, I was thinking that should give it enough 
> >time
> > > to send everything. I guess Pd isn't crashing anymore at least ;)
> > > You could try changing line 383 of tcpserver.c to change the timeout:
> > > timeout.tv_sec = 10; /* for ten seconds */
> >
> >probably, i should add, that i am testing the new [tcpserver] code on
> >ubuntu 8.04, as i don't know how to compile on OS X or win XP. what are
> >you testing on?
> >
> OK I fixed it now in svn. It works on debian. The select() call was not 
> being done properly. Now I need to test it on Windows again.

hey, many thanks! it works. now i wonder, what happens, if the message
is triggered: 'tcpserver_send_buf: client 1 not writeable'. does that
indicated, that the buffer is cleared? does it mean, that when this
message appears, that at least one message didn't come through?

somehow i need to design netpd in way, that as soon as one single
message is lost, the connection should be shut down and established
again, and the client should then again sync with other clients.
otherwise very bad things could happen (patches are not transmitted
completely and loading incomplete patches causes pd crashing). 

before the change i could be sure, that either all messages came through
or the server crashed at some point, if messages could not be delivered.
now, since the server doesn't crash anymore, i need to know, if messages
were dropped. how can i know?

thanks again for all your effort.


Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

More information about the Pd-list mailing list