I am trying to implement a HttpWebRequest timeout for my WP7 app, as the user could make a request, and the request will never come back, leaving a ProgressBar I have on the screen.
I saw this MSDN page: msdn page
Which uses
ThreadPool.RegisterWaitForSingleObject (result.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), myHttpWebRequest, DefaultTimeout, true); I was able to add this code, and link up all the variables, but when I add it to my code, It gives a NotSupportedOperation when getting to the line:
allDone.WaitOne(); If i comment it out, it gives the same NotSupportedOperation at my next line,
return _result_object; (function is private object SendBeginRequest())
How can I add a timeout in WP7? This way does not seem to work. I would prefer not to use WebClient due to the UI thread issue.