Async read from SerialPort.BaseStream with timeout

  • Thread starter Thread starter EuroEager
  • Start date Start date
E

EuroEager

Guest
Say I want to read n bytes from a SerialPort asynchronously (by using "int readBytes = await SerialPort.BaseStream.ReadAsync(buffer, offset, n)" method)

How to detect if n bytes have been read within a given timeout?
(Setting BaseStream.ReadTimeout = timeout seemingly doesn't timeout the task if n bytes have not yet been received)

Continue reading...
 
Back
Top