I have this code to read from a serial port. I set the timeout to 6.5 seconds. Quite often I have an issue where I don't get a response from the device because system resources are being hogged by something else. Alot of times it takes way longer than 6.5 seconds to throw the timeout exception.
Is there a way to lock down the system resources to only be doing this loop?
Code:
_serialPort.ReadTimeout = 6500
Do
i = _serialPort.ReadByte
bytes.Add(CByte(i))
Loop Until i = 3 AndAlso _serialPort.BytesToRead = 1
Comment