Hello fellow Rustaceans!
I have an unusual problem (I only have unusual problems...). I work with a device connected via USB serial port to a FreeBSD box (visible as
My problem is that said device occasionally disconnects itself (say, powercycle), but
tokio-serial seems not to notice that and waits for data forever. I examined the examples from ground up and the culprit seems to be in
serialport, in the example
receive_data.rseverything works as expected - on disconenct I'm greeted by a wall of
PipeBrokenerrors on read. This is good™.
mio-serial, in the example of
read_serialport.rs, the event of disconnection seems to be swallowed before reaching
poll.poll(...), which in turn continues to wait indefinitely for data that no longer can come. For whatever reason, timeouts also seem not to be fired despite being set as low as 100ms...
I even tried circumnavigating the problem via a set of
devd.conf rules called on creation/destruction of
ttyU? devices that poke my process with
SIGUSR1. The problem is that as long as the device is held open by my program, its entry does not disappear from
devd rules are not fired.
Any hints on where to look?