https://bugs.winehq.org/show_bug.cgi?id=57399
Bug ID: 57399 Summary: [wine-mono] ReadTimeout of SerialPort not working properly Product: Wine Version: 9.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: serial Assignee: wine-bugs@winehq.org Reporter: osu_Vanilla@126.com Distribution: ---
The following code set ReadTimeout to 500ms, and call the function Read. When COM33 receives nothing, it should throw TimeoutException after timeout.
But wine stuck on the Read operation, until it received 4096 (or more) bytes.
``` using System.IO.Ports;
namespace ConsoleApplication1 { internal class Program { public static void Main(string[] args) { var serialPort = new SerialPort("COM33", 9600, Parity.None, 8, StopBits.One); serialPort.ReadTimeout = 500; serialPort.WriteTimeout = 500; serialPort.Open(); var buff = new byte[4096]; serialPort.Read(buff, 0, 4096); } } } ```