Chris Galas writes:
> 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.

Are you sure this actually is a libev issue?

I have become quite frustrated with unreliable USB serial adapters,
to the point where I started to use the UART of an embedded board instead.

In particular I had trouble with chinese pl2303 clones that just stop
sending data after a while until you reset them by close()/open() the
device file.

> 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?

This fits in as well: The USB serial adapters I'm talking about are less
likely to hang up if the flow of data is slowed down. Maybe you can test
your HW with minicom or some other software without libev to check if
it's a HW issue ...

HTH,
Harald

-- 
If you want to support my work:
see http://friends.ccbib.org/harald/supporting/
or donate via peercoin to P98LRdhit3gZbHDBe7ta5jtXrMJUms4p7w
or bitcoin 1FUtd8T9jRN1rFz63vZz7s2fDtB6d6A7aS

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/libev

Reply via email to