serialport / serialport-rs

A cross-platform serial port library in Rust. Provides a blocking I/O interface and port enumeration including USB device information.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

separate read and write timeout settings

jhfrontz opened this issue · comments

Sometimes you want to, say, allow a long time for a buffer to be written but you want a quick read attempt (e.g., in a polling loop).

How hard would it be to implement separate read and write timeouts (a la https://doc.rust-lang.org/std/net/struct.TcpStream.html#method.set_read_timeout and https://doc.rust-lang.org/std/net/struct.TcpStream.html#method.set_write_timeout)?

It looks like it would be easy to split it for the posix side (since there are separate poll calls for read/write). The windows side looks like it might be similarly easy, but I have no experience with windows.