ServicePoint.IdleSince 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取上次将 ServicePoint 对象连接到主机的日期和时间。
public:
property DateTime IdleSince { DateTime get(); };
public DateTime IdleSince { get; }
member this.IdleSince : DateTime
Public ReadOnly Property IdleSince As DateTime
属性值
DateTime 对象,包含上次连接 ServicePoint 对象的日期和时间。
示例
下面的代码示例使用 IdleSince 属性设置和检索对象上次连接到主机的日期和时间 ServicePoint 。
// Display the date and time that the ServicePoint was last
// connected to a host.
Console::WriteLine( "IdleSince = {0}", 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( "MaxIdleTime = {0}", sp->MaxIdleTime );
// 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);
' 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()))
注解
属性 IdleSince 记录服务点与主机断开连接的最后日期和时间。 当当前时间和 IdleSince 之间的差超过 的值 MaxIdleTime时, ServicePoint 对象可用于回收到另一个连接。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈