Closed Ed156 closed 8 years ago
That is strange. I'll take a look at this problem.
Great, let me know if you need more info.
@Ed156, have you tried to disable the context capture?
var response = await restClient.Execute<List<T>>(request).ConfigureAwait(false);
Thanks evnik, I just tried that but it did not seem to make a difference. I will do more testing though.
I have been testing more, and the problem persists. Disabling the context capture does not make a difference. I am testing forms with a request that returns 700 Kb of data. I start the form about 5 times simultanously. Some forms get the data, but most not. When not, the code after the await restClient.Execute is never reached.
Fiddler does show ALL the requests however, with the correct size and 200 resultcode!
Another strange thing is that, when loading my app, a call to the same method creates problems because after the call to restClient.Execute, the current thread is changed from Main thread to Worker thread. This creates errors of course when I do ui stuff afterwards. The result value is ok though.
Could this be related?
Are there known issues with using this lib from Winforms?
I changed my code to use HttpClient and Json.net directly. Problem solved.
Hi there,
I have implemented RestSharp.Portable v3.3 in a WinForms MDI application, using async a lot.
It works, but when stress testing the application (starting multiple windows simultanously) I notice that regularly the below method stays in the restClient.Execute line. I also tried to add a CancellationTokenSource to set a timeout but I see no difference, it does not timeout. On the cases it hangs, the lines after the Execute call are not reached anymore during the rest of the time the application runs.
Anyone have any idea what could be the problem?