Modifier

Partager via


ChannelFactoryBase<TChannel>.OnClose(TimeSpan) Method

Definition

Closes all the channels associated with the channel factory within a specified interval of time.

protected:
 override void OnClose(TimeSpan timeout);
protected override void OnClose (TimeSpan timeout);
override this.OnClose : TimeSpan -> unit
Protected Overrides Sub OnClose (timeout As TimeSpan)

Parameters

timeout
TimeSpan

The TimeSpan that specifies how long the on-close operation has to complete before timing out.

Remarks

This method sequentially attempts to close all of the active channels associated with the channel factory in no particular order. The timeout parameter is the cumulative amount of time available for closing all of the channels. If a graceful close of one of the channels fails (for example, if the channel is faulted causing an exception to be thrown) then this operation fails and does not attempt to close the remaining channels. Failure in this method causes the factory and any remaining channels to be aborted rather than closed.

This method is called by Close.

Applies to