ServicePoint Class
TOC
Collapse the table of content
Expand the table of content

ServicePoint Class

 

Provides connection management for HTTP connections.

Namespace:   System.Net
Assembly:  System (in System.dll)

System.Object
  System.Net.ServicePoint

type ServicePoint = class end

NameDescription
System_CAPS_pubpropertyAddress

Gets the Uniform Resource Identifier (URI) of the server that this ServicePoint object connects to.

System_CAPS_pubpropertyBindIPEndPointDelegate

Specifies the delegate to associate a local IPEndPoint with a ServicePoint.

System_CAPS_pubpropertyCertificate

Gets the certificate received for this ServicePoint object.

System_CAPS_pubpropertyClientCertificate

Gets the last client certificate sent to the server.

System_CAPS_pubpropertyConnectionLeaseTimeout

Gets or sets the number of milliseconds after which an active ServicePoint connection is closed.

System_CAPS_pubpropertyConnectionLimit

Gets or sets the maximum number of connections allowed on this ServicePoint object.

System_CAPS_pubpropertyConnectionName

Gets the connection name.

System_CAPS_pubpropertyCurrentConnections

Gets the number of open connections associated with this ServicePoint object.

System_CAPS_pubpropertyExpect100Continue

Gets or sets a Boolean value that determines whether 100-Continue behavior is used.

System_CAPS_pubpropertyIdleSince

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

System_CAPS_pubpropertyMaxIdleTime

Gets or sets the amount of time a connection associated with the ServicePoint object can remain idle before the connection is closed.

System_CAPS_pubpropertyProtocolVersion

Gets the version of the HTTP protocol that the ServicePoint object uses.

System_CAPS_pubpropertyReceiveBufferSize

Gets or sets the size of the receiving buffer for the socket used by this ServicePoint.

System_CAPS_pubpropertySupportsPipelining

Indicates whether the ServicePoint object supports pipelined connections.

System_CAPS_pubpropertyUseNagleAlgorithm

Gets or sets a Boolean value that determines whether the Nagle algorithm is used on connections managed by this ServicePoint object.

NameDescription
System_CAPS_pubmethodCloseConnectionGroup(String)

Removes the specified connection group from this ServicePoint object.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodSetTcpKeepAlive(Boolean, Int32, Int32)

Enables or disables the keep-alive option on a TCP connection.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The ServicePoint class handles connections to an Internet resource based on the host information passed in the resource's Uniform Resource Identifier (URI). The initial connection to the resource determines the information that the ServicePoint object maintains, which is then shared by all subsequent requests to that resource.

ServicePoint objects are managed by the ServicePointManager class and are created, if necessary, by the ServicePointManager.FindServicePoint method. ServicePoint objects are never created directly but are always created and managed by the ServicePointManager class. The maximum number of ServicePoint objects that can be created is set by the ServicePointManager.MaxServicePoints property.

Each ServicePoint object maintains its connection to an Internet resource until it has been idle longer than the time specified in the MaxIdleTime property. When a ServicePoint exceeds the MaxIdleTime value, it can be recycled to another connection. The default value of MaxIdleTime is set by the ServicePointManager.MaxServicePointIdleTime property.

When the ConnectionLeaseTimeout property is set to a value other than -1, and after the specified time elapses, an active ServicePoint connection is closed after it services the next request. This is useful for applications that do not require active connections that are opened indefinitely, as they are by default.

System_CAPS_noteNote

In high load conditions, some applications may run out of free threads in the ThreadPool, which may lead to poor system performance (such as high and variable transaction times). See http://msdn.microsoft.com/library/default.asp?url=/library/dnpag/html/scalenetchapt17.asp for a number of configuration changes you can make to fix this issue.

The following code example creates a ServicePoint object that connects to the URI www.contoso.com.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft