System.Net.ServicePoint Class

public class ServicePoint

Base Types

Object
  ServicePoint

Assembly

System

Library

Networking

Summary

Represents connections to Internet hosts.

Description

The ServicePoint class handles connections to a resource based on the host information passed in the Uniform Resource Identifier (URI) of the resource. The initial connection to the host determines the information the ServicePoint maintains, which is then shared by all subsequent requests for resources residing on the host.

[Note: ServicePoint instances are created and managed by the ServicePointManager class. The maximum number of ServicePoint instances is set by the System.Net.ServicePointManager.MaxServicePoints property.

A ServicePoint instance that is not connected to any host is idle. An idle ServicePoint is managed by the ServicePointManager only until it has been idle longer than the time specified in its System.Net.ServicePoint.MaxIdleTime property. After a ServicePoint instance exceeds the System.Net.ServicePoint.MaxIdleTime , it is released by the service point manager and subsequently freed. The default value of System.Net.ServicePoint.MaxIdleTime is set by the System.Net.ServicePointManager.MaxServicePointIdleTime property.

]

See Also

System.Net Namespace

Members

ServicePoint Methods

ServicePoint.GetHashCode Method

ServicePoint Properties

ServicePoint.Address Property
ServicePoint.ConnectionLimit Property
ServicePoint.ConnectionName Property
ServicePoint.CurrentConnections Property
ServicePoint.IdleSince Property
ServicePoint.MaxIdleTime Property
ServicePoint.ProtocolVersion Property
ServicePoint.SupportsPipelining Property


ServicePoint.GetHashCode Method

public override int GetHashCode();

Summary

Generates a hash code for the current instance.

Return Value

A Int32 containing the hash code for this instance.

Description

The algorithm used to generate the hash code is unspecified.

[Note: This method overrides System.Object.GetHashCode.]

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.Address Property

public Uri Address { get; }

Summary

Gets the Uniform Resource Identifier (URI) of the ServicePoint.

Property Value

A Uri instance representing the URI specified at the time the current instance was constructed .

Description

This property is read-only.

[Note: The System.Uri.Host property of the Uri returned by this property names the host to which the current instance connects.]

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.ConnectionLimit Property

public int ConnectionLimit { get; set; }

Summary

Gets or sets the maximum number of simultaneous connections that the ServicePoint can make to an Internet host.

Property Value

A Int32 containing the maximum number of simultaneous connections allowed on the current ServicePoint.

Exceptions

Exception TypeCondition
ArgumentOutOfRangeExceptionThe value specified for a set operation is less than or equal to zero.

Description

[Note: When the ServicePoint is created, the value of this property is determined by the value of the System.Net.ServicePointManager.DefaultConnectionLimit property. Note that subsequent changes to System.Net.ServicePointManager.DefaultConnectionLimit have no effect on existing ServicePoint instances.]

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.ConnectionName Property

public string ConnectionName { get; }

Summary

Gets the connection group name specified by the WebRequest that created the connection.

Property Value

A String containing the value of the System.Net.WebRequest.ConnectionGroupName property of the WebRequest that initiated the connection provided by the current instance.

Description

This property is read-only.

[Note: If this property is set, only WebRequest instances with the same System.Net.WebRequest.ConnectionGroupName can communicate with the host using the current instance.]

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.CurrentConnections Property

public int CurrentConnections { get; }

Summary

Gets the number of connections held by the current instance.

Property Value

A Int32 containing the number of connections held by the current instance.

Description

This property is read-only.

[Note: The value of System.Net.ServicePoint.CurrentConnections cannot exceed that of System.Net.ServicePoint.ConnectionLimit.]

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.IdleSince Property

public DateTime IdleSince { get; }

Summary

Gets the date and time that the ServicePoint was last connected to a host.

Property Value

A DateTime instance containing the date and time at which the ServicePoint was last connected.

Description

This property is read-only.

[Note: When the difference between the current time and System.Net.ServicePoint.IdleSince exceeds the value of System.Net.ServicePoint.MaxIdleTime, the current instance is released by the ServicePointManager and subsequently freed.]

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.MaxIdleTime Property

public int MaxIdleTime { get; set; }

Summary

Gets or sets the maximum amount of time the current instance can remain idle (unconnected to a host).

Property Value

A Int32 containing the number of milliseconds that a ServicePoint can remain idle before it is released by the ServicePointManager and subsequently freed.

Exceptions

Exception TypeCondition
ArgumentOutOfRangeExceptionThe value specified for a set operation is less than System.Threading.Timeout.Infinite or greater than System.Int32.MaxValue.

Description

[Note: When the difference between the current time and System.Net.ServicePoint.IdleSince exceeds the value of System.Net.ServicePoint.MaxIdleTime, the current instance is released by the ServicePointManager and subsequently freed.]

The default value of this property is the value of the System.Net.ServicePointManager.MaxServicePointIdleTime property at the time the ServicePoint was created.

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.ProtocolVersion Property

public virtual Version ProtocolVersion { get; }

Summary

Gets the version of the protocol that the ServicePoint uses.

Property Value

A Version instance containing the version of the protocol used by the ServicePoint .

Description

This property is read-only.

[Behaviors: As described above. ]

[Default: This property returns a Version instance initialized to System.Net.HttpVersion.Version11.]

[Overrides: Override this property to return the version information for types derived from ServicePoint.]

[Usage: Use this property to determine the protocol version information used by the current instance.]

See Also

System.Net.ServicePoint Class, System.Net Namespace

ServicePoint.SupportsPipelining Property

public bool SupportsPipelining { get; }

Summary

A Boolean value that indicates whether the ServicePoint supports pipelined connections.

Property Value

true if the ServicePoint supports pipelined connections; otherwise, false .

Description

This property is read-only.

[Note: For information on pipelining, see IETF RFC 2068.]

See Also

System.Net.ServicePoint Class, System.Net Namespace