Terminate a thread after an interval if not returned

I have a thread which grabs some data from network or serial port. The thread must terminate (or return false) if no data is received within 5 seconds.

In other words, if running the thread is taking more than 5 seconds it must stop.

I am writing in C#, but any .NET language is OK.

13
задан Andrii Kalytiiuk 5 August 2013 в 09:24
поделиться