I’m using the SerialDataReceivedEventHandler to know when my SerialPort object receives data.
Is it possible to know when I won’t be receiving anymore data because the inter-byte timeout has occurred?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, a TimeoutException is only raised when you call Read() and there is no data to read. The DataReceived event is fired when there is data available so the Read() call can never raise that exception.
A simple workaround is to use your own Timer. Call its Stop() and Start() method in your event handler to reset the timer. And declare failure when its Tick event fires.