0
Follow
0
View

I sent over than 100 requests to web service [duplicate]

duguqiangwei 注册会员
2023-01-25 14:56

This is not a parallel.foreach issue - the issue is ServicePointManager which throttles the number of parallel requests to any domain name. The standard is, as you found out, 4 parallel requests.

https://learn.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=net-5.0

Parallel.ForEach will quue all the tasks, but then the requests run into the limitation. Oh, and that manager can be configured ;)

About the Author

Question Info

Publish Time
2023-01-25 14:56
Update Time
2023-01-25 14:56