Steven
Steven

Reputation: 4963

Limit of concurrent HttpWebRequests

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

Upvotes: 1

Views: 1026

Answers (2)

Thomas Levesque
Thomas Levesque

Reputation: 292405

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)

Upvotes: 2

Jon Skeet
Jon Skeet

Reputation: 1500055

I'm not sure of an overall limit, but there's certainly a limit to the number of concurrent connections to a single host name.

It can be configured in the <connectionManagement> element of app.config.

Upvotes: 2

Related Questions