Suppose I read data from SerialPort whenever there is 100 bytes available or else nothing is done. That means, the remaining data will still be available in the SerialPort Buffer. This reading is done inside the event handler of DataReceived.
Now suppose a situation arises, when there there is, say 50 bytes in the SerilaPort Buffer and no more data comes. From what I understand, the DataReceived Event will be triggered whenever there is certain amount of bytes available for reading from the Buffer.
Now, in the given scenario, if I never read those 50 bytes, will the Event get activated continuously due to the presence of these unread bytes?
I did post the answer(see comments above). It is in the documentation. ” …when data is received from the SerialPort object.”
The OP said “if I never read those 50 bytes, will the Event get activated continuously due to the presence of these unread bytes?” and you replied “Yes, it will keep firing until you call Read().”
The event only fires whenever new data is received. If you do not process that piece of data, that piece of data will NOT cause a new event. However, if new data arrives, a new event will fire and you can then process it all.