Mono or .NET Serialport frequent reads result in high cpu
问题 I'm developing an app that polls RS232 to I2C converter, to which i have an i2c device connected, that has to be polled in realtime, meaning constantly :D As soon as response comes i reissue the command again... my code: lock (_locker) { try { _serialPort.DiscardInBuffer(); _serialPort.Write(sendArray, 0, sendArray.Length); _serialPort.ReadFixed(headerArray, headerArray.Length); returnOperation = (DeviceOperation)((int)headerArray[1] << 8 | (int)headerArray[3]); DataToReceive = headerArray[5]