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.