The [AsyncTimeout] attribute controls the maximum time to wait when the XxAsync() method kicks off an async operation, like making a network request. The timer doesn't start until the IndexAsync() method returns. Since Thread.Sleep() is a synchronous operation,
it blocks IndexAsync() from returning in your example.
Marked as answer by Doggy8088 on Jun 02, 2010 06:52 PM
levib
Star
7702 Points
1099 Posts
Microsoft
Re: The AsyncTimeout filter doesn't works
Jun 01, 2010 07:13 PM|LINK
The [AsyncTimeout] attribute controls the maximum time to wait when the XxAsync() method kicks off an async operation, like making a network request. The timer doesn't start until the IndexAsync() method returns. Since Thread.Sleep() is a synchronous operation, it blocks IndexAsync() from returning in your example.