title: How to correctly use SerialPort.DiscardInBuffer?
body: <p>I've written an application which reads from a serial device at a very fast rate. The serial port object however, fails to fire the <code>DataReceieved</code> event after about 20 min of continuous operation. Disconnecting and reconnecting the serial programmatically allows the event to work again but for only another 20 min.</p>
  
  <p>I tried using <code>DiscardInBuffer</code> after every <code>DataReceived</code> event and this has appeared to have solved the problem. But the method consumes a lot of cpu time and is degrading the performance of the application. MSDN mentions that the method "Discards data from the serial driver's receive buffer.", but fails to suggest when it should be used.</p>
  
  <p>When and how should <code>DiscardInBuffer</code> be used, and am I using it in the correct context for my particular problem ?</p>
  
  <p>Edit:</p>
  
  <p>After implementing the <code>ErrorReceived</code> event, the event data returned indicated the event type was an "RXOver".</p>