What is ServicePointManager.FindServicePoint used for?

Can someone explain what ServicePointManager.FindServicePoint is for? I wrote code for working with proxy servers in C # and saw indicators that may be useful in this regard, but they cannot understand why and how. How should this class (ServicePointManager) or method (ServicePointManager.FindServicePoint) be used (or when)?

Thanks.

+3
source share
1 answer

The method ServicePointManager.FindServicePoint(...)will help you get the object ServicePointthat you specified in the configuration file.

Let's say this is your configuration file:

<configuration>
 <system.net>
  <connectionManagement>
   <add address="http://www.contoso.com" maxconnection="2" />
   <add address="192.168.1.2" maxconnection="4" />
   <add address="*" maxconnection="1" />
  </connectionManagement>
 </system.net>
</configuration>

" http://www.microsoft.com" ServicePoint:

ServicePoint sp1 = ServicePointManager.FindServicePoint(new Uri("http://www.microsoft.com"));

.

+3

Source: https://habr.com/ru/post/1726074/


All Articles