Reading serial ports with a timeout...

Dirk Koopman djk at tobit.co.uk
Fri Jul 19 18:07:59 CEST 2013


I am trying to read data from a serial port connected to a device which 
will go to sleep at the drop of a hat. I would like to use 
AnyEvent::Handle pushing simple reads with either a regex or chunked 
type. But I want to place a timeout on that push_read, such that the 
push_read exits cleanly (with, by definition, no or not enough valid data).

I suspect I can do it all by hand in an on_read, but I would like to 
leverage the AE::Handle push_read interface if possible.

Dirk





More information about the anyevent mailing list