This documentation is archived and is not being maintained.

ServicePoint.IdleSince Property

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

[Visual Basic]
Public ReadOnly Property IdleSince As DateTime
[C#]
public DateTime IdleSince {get;}
[C++]
public: __property DateTime get_IdleSince();
[JScript]
public function get IdleSince() : DateTime;

Property Value

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

Remarks

The IdleSince property records the last date and time at which a service point was disconnected from a host. When the difference between the current time and IdleSince exceeds the value of MaxIdleTime, the ServicePoint is available for recycling to another connection.

Example

[Visual Basic, C#, C++] The following example uses the IdleSince property to set and retrieve the date and time that the ServicePoint was last connected to a host.

[Visual Basic] 
' Display the date and time that the ServicePoint was last 
' connected to a host.
Console.WriteLine(("IdleSince = " + sp.IdleSince.ToString()))


' Display the maximum length of time that the ServicePoint instance 
' is allowed to maintain an idle connection to an Internet  
' resource before it is recycled for use in another connection.
Console.WriteLine(("MaxIdleTime = " + sp.MaxIdleTime.ToString()))


[C#] 
// Display the date and time that the ServicePoint was last 
// connected to a host.
Console.WriteLine ("IdleSince = " + sp.IdleSince.ToString ());

// Display the maximum length of time that the ServicePoint instance  
// is allowed to maintain an idle connection to an Internet  
// resource before it is recycled for use in another connection.
Console.WriteLine ("MaxIdleTime = " + sp.MaxIdleTime);


[C++] 
// Display the date and time that the ServicePoint was last 
// connected to a host.
Console::WriteLine(S"IdleSince = {0}", __box(sp->IdleSince));


// Display the maximum length of time that the ServicePoint instance  
// is allowed to maintain an idle connection to an Internet  
// resource before it is recycled for use in another connection.
Console::WriteLine(S"MaxIdleTime = {0}", __box(sp->MaxIdleTime));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

ServicePoint Class | ServicePoint Members | System.Net Namespace

Show: