This is my code, I'm using AsyncEx in my library to try to get around potential deadlocks, but I ended up in there anyway:
return AsyncContext.Run(async () =>
{
var get = await httpClient.GetAsync(url);
if (get.IsSuccessStatusCode && (get.StatusCode == HttpStatusCode.OK))
{
var content = await get.Content.ReadAsStringAsync();
return content;
}
return "";
});
I'm running this from a command line app, calling it with multiple different url
values in a row, but synchronously in one big for
loop. Given enough calls, it will eventually stop dead in its tracks. Am I doing something wrong?