言語

ChannelDispatcher.TransactionTimeout プロパティ

定義

サービスの代わりにディスパッチャーによって作成された新しいトランザクションの既定のタイムアウトを指定する値を取得または設定します。

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

プロパティ値

トランザクションの既定のタイムアウト期間を表す TimeSpan 値。 既定値は Zero です。

例外

値セットが 0 未満であるか、大きすぎます。

通信オブジェクトが Opening または Opened 状態です。

通信オブジェクトが Closing または Closed 状態です。

通信オブジェクトが Faulted 状態です。

Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

serviceHost.Open();

IChannelListener icl = serviceHost.ChannelDispatchers[0].Listener;
ChannelDispatcher dispatcher = new ChannelDispatcher(icl);
dispatcher.TransactionTimeout = new TimeSpan(100);
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

serviceHost.Open()

Dim icl As IChannelListener = serviceHost.ChannelDispatchers(0).Listener
Dim dispatcher As New ChannelDispatcher(icl)
dispatcher.TransactionTimeout = New TimeSpan(100)

注釈

このプロパティは、変更可能で破棄されない唯一の状態であるため、 ChannelDispatcher のインスタンスが Created 状態の場合にのみ設定できます。

適用対象