HttpClient - task was cancelled - How to get the exact error message?

前端 未结 4 1976
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 01:44

I have the following test code. I always get the \"Task was cancelled\" error after looping 316934 or 361992 times.

If I am not wrong, there are two possible reasons why

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-31 02:40

    just wanted to share I have had a similar code to load test our servers ,and its a high probability that your requests are timing out. You can set the timeout for your http request to max and see if it changes anything for you. I tried hitting our servers by creating various threads. And it increased the hits but they would all eventually timeout.And also you cannot set a timeout when hitting them on another thread.

提交回复
热议问题