On This Page
Examples
You can increase the number of connections in many ways, for example by using an application- or server-specific configuration file where you can change the setting for a single or for all hosts. The examples below describe briefly some of the methods that you can use to increase connection limits.
cybs.connectionLimit
When set to a value other than
-1
, the cybs.connectionLimit
setting in the client increases the limit for the host where you are sending the
request by executing these statements on your behalf:ServicePoint sp = ServicePointManager.FindServicePoint(uri); sp.ConnectionLimit = config.ConnectionLimit;
<connectionManagement>
You can set the connection limit by using .NET's
<connectionManagement>
tag. In this example, the connection limit for Cybersource
test and production
hosts is 12 while the limit for all other hosts is 2:<system.net> <connectionManagement> <add address = "https://ics2wstesta.ic3.com" maxconnection = "12" /> <add address = "https://ics2wsa.ic3.com" maxconnection = "12" /> <add address = "*" maxconnection = "2" /> </connectionManagement> </system.net>
DefaultConnectionLimit
You can set the connection limit for all hosts to which your application is connected before a connection is made by using the following line in your start-up code:
ServicePointManager.DefaultConnectionLimit = your_value_here;