IContextChannel.OperationTimeout 属性

定义

获取或设置一个时间段,操作必须在此时间段内完成否则将引发异常。Gets or sets the time period within which an operation must complete or an exception is thrown.

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

属性值

TimeSpan,指定操作必须在此期间内完成的时间段。The TimeSpan that specifies the time period within which an operation must complete.

注解

如果对绑定或通道启用了事务流,执行操作所需的时间可能会比指定的超时时间长。If transaction flow is enabled on the binding or the channel, the operation may take longer to execute than the specified timeout. 在这些情况下,将会因为超时过期而导致操作失败,事务也将相应中止。In these circumstances the operation will fail due to the expired timeout and the transaction will abort appropriately.

适用于