tokio-serial icon indicating copy to clipboard operation
tokio-serial copied to clipboard

On FreeBSD tokio-serial seems not to notice, that port is (physically) removed during wait for inbound data

Open p-kraszewski opened this issue 3 years ago • 0 comments

Environment

  • OS: FreeBSD 13.1-RELEASE GENERIC, default config
  • Rust: 1.62.0 (a8314ef7d 2022-06-27)
  • tokio-serial v5.4.3
  • mio-serial v5.0.2
  • serialport v4.2.0

Test scenario

  • FreeBSD box with USB-Serial adapter (device at /dev/ttyU0)
  • The tokio-serial is waiting for inbound data (reacts as expected on inbound data, the codec framework is exceptional!)
  • I yank the adapter from socket EDIT: (/dev/ttyU0 does not disappear as long as program holds it)
  • The tokio-serial is still waiting... For something... Crickets...
  • As /dev/ttyU0 is still held, after re-plugging the adapter registers as /dev/ttyU1
  • The tokio-serial is still waiting... For something... Crickets...

Expected behavior

After yanking the cable, XXX.next() should return error on next poll.

Is that something to be resolved at the tokio-serial or mio-serial level?

Best regards

p-kraszewski avatar Jul 01 '22 09:07 p-kraszewski