[PD] preventing comport freezes

Martin Peach martin.peach at sympatico.ca
Fri May 8 14:14:46 CEST 2009


Hans-Christoph Steiner wrote:
> 
> So right now, when [comport] is open and that device gets disconnected, 
> comport freezes and Pd crashes.  My guess is that comport is waiting and 
> therefore blocking.  It seems like the select() call should prevent 
> that, any other guesses on how to prevent comport from locking like 
> this?  Many arduino users would be very happy.
> 

Is this on linux? It should be non-blocking on Windows.
I suppose it crashes only when you try to send something, not if you 
just pull the cable out. I would have thought that if hardware 
handshaking was off, the port will send anyway. I seem to remember 
sending into an oscilloscope probe with no cable present.
Select is problematic, as we have seen with recent [tcpserver], checking 
if each byte can be sent before it goes out slows the whole thing down a 
lot.

Martin





More information about the Pd-list mailing list