Limit of concurrent HttpWebRequests

后端 未结 2 686
北恋
北恋 2021-01-27 04:17

Is there a limit to the number of concurrent HttpWebRequests .NET will allow at one time?

2条回答
  •  星月不相逢
    2021-01-27 04:50

    As Jon explained, the limit can be set in config. But you can also change it at runtime by setting the ServicePoint.ConnectionLimit for a specific ServicePoint, or the ServicePointManager.DefaultConnectionLimit static property (will apply to service points created after you set it). The default value is 2 connections per service point (DefaultPersistentConnectionLimit constant)

提交回复
热议问题