ShelbyZ / UCWA.NET

Set of .NET libraries to communicate with UCWA
MIT License
4 stars 2 forks source link

[SimpleTransport] Blocking behavior in Asp.Net context #2

Open Herve-M opened 7 years ago

Herve-M commented 7 years ago

Hello,

It tried to use the SimpleTransport in a basic Asp.Net application and their is a little problem.

The ExecuteRequestAsync never return, only timeout after a very long time. It do it only on Asp.Net context with 4.6.X. After some research, obj.GetResponseAsync() throw a System.Net.WebException as expected but the await block it (or something like that). Migrating to a wait/result usage, it return a AggregateException etc..

Herve-M

Herve-M commented 7 years ago

Ok after some research and test, I can say that nested await are blocking on ASP.Net env. Sometime inner await are ignored.

Solution was to avoid to save the Context during call, with ConfigureAwait(false) on: TransportProxy, SimpleTransport, Authentification, Discovery.

Herve-M