FindServicePoint() public static method

public static FindServicePoint ( Uri address ) : ServicePoint
address System.Uri
return ServicePoint
Example #1
0
        ServicePoint GetServicePoint()
        {
            if (servicePoint == null)
            {
                servicePoint = ServicePointManager.FindServicePoint(requestUri, proxy);
            }

            return(servicePoint);
        }
Example #2
0
		// Methods
		
		internal ServicePoint GetServicePoint ()
		{
			lock (locker) {
				if (hostChanged || servicePoint == null) {
					servicePoint = ServicePointManager.FindServicePoint (actualUri, proxy);
					hostChanged = false;
				}
			}

			return servicePoint;
		}
 /// <summary>Finds an existing <see cref="T:System.Net.ServicePoint" /> object or creates a new <see cref="T:System.Net.ServicePoint" /> object to manage communications with the specified Uniform Resource Identifier (URI).</summary>
 /// <returns>The <see cref="T:System.Net.ServicePoint" /> object that manages communications for the request.</returns>
 /// <param name="uriString">The URI of the Internet resource to be contacted. </param>
 /// <param name="proxy">The proxy data for this request. </param>
 /// <exception cref="T:System.UriFormatException">The URI specified in <paramref name="uriString" /> is invalid. </exception>
 /// <exception cref="T:System.InvalidOperationException">The maximum number of <see cref="T:System.Net.ServicePoint" /> objects defined in <see cref="P:System.Net.ServicePointManager.MaxServicePoints" /> has been reached. </exception>
 /// <PermissionSet>
 ///   <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
 ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
 /// </PermissionSet>
 public static ServicePoint FindServicePoint(string uriString, IWebProxy proxy)
 {
     return(ServicePointManager.FindServicePoint(new System.Uri(uriString), proxy));
 }
 /// <summary>Finds an existing <see cref="T:System.Net.ServicePoint" /> object or creates a new <see cref="T:System.Net.ServicePoint" /> object to manage communications with the specified <see cref="T:System.Uri" /> object.</summary>
 /// <returns>The <see cref="T:System.Net.ServicePoint" /> object that manages communications for the request.</returns>
 /// <param name="address">The <see cref="T:System.Uri" /> object of the Internet resource to contact. </param>
 /// <exception cref="T:System.ArgumentNullException">
 ///   <paramref name="address" /> is null. </exception>
 /// <exception cref="T:System.InvalidOperationException">The maximum number of <see cref="T:System.Net.ServicePoint" /> objects defined in <see cref="P:System.Net.ServicePointManager.MaxServicePoints" /> has been reached. </exception>
 /// <PermissionSet>
 ///   <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
 ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
 /// </PermissionSet>
 public static ServicePoint FindServicePoint(System.Uri address)
 {
     return(ServicePointManager.FindServicePoint(address, GlobalProxySelection.Select));
 }