ev_io write/read timing issue

Chris Galas ChrisG at nytec.com
Mon Feb 15 23:31:08 CET 2016


I've come upon a strange issue.

I'm reading data from a USB serial port on Linux, using separate reader and writer ev_io watchers. Commands (bytes) are written to the file descriptor in a write call back and bytes are read back on a read call back. This works for about 80 write/read exchanges until the read call back function is no longer called and the program blocks, no longer calling the read call back function.

I suspect it's some timing issue but I'm not sure what at time this. I can put in 50ms usleeps between read and writes, but that only delays the block. Are there timing issues when using a pair of ev_io read/write watchers? 

I've included a simple example with some output here: https://github.com/oldmancoyote/some_test_code




More information about the libev mailing list