LocalServiceSecuritySettings.TimestampValidityDuration 属性

定义

获取或设置消息在由服务发送时的最长有效时间。Gets or sets the maximum duration of time that messages are valid when sent by the service. 如果客户端在此期间后收到服务的消息,该客户端将丢弃该消息。If the client receives the service's message after this duration, it discards the message.

public:
 property TimeSpan TimestampValidityDuration { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan TimestampValidityDuration { get; set; }
member this.TimestampValidityDuration : TimeSpan with get, set
Public Property TimestampValidityDuration As TimeSpan

属性值

TimeSpan

消息在由服务发送时的最长有效时间。The maximum duration of time that messages are valid when sent by the service. 默认为 5 分钟。The default is 5 minutes.

例外

该属性已设置为小于 0 的值。The property is set to a value less than 0.

示例

此示例演示如何获取 TimestampValidityDuration 值。This example shows how to get the TimestampValidityDuration value.

TimeSpan timestampValidityDuration =
settings.TimestampValidityDuration;
Dim timestampValidityDuration As TimeSpan = settings.TimestampValidityDuration

适用于