UaClient/ServiceModel/Ua/Channels/CommunicationObject.cs
/// <summary>
/// Inserts processing on a communication object after it transitions to the faulted state due to the FaultAsync operation.
/// </summary>
/// <param name="token">The <see cref="T:System.Threading.CancellationToken" /> that notifies when the task should be canceled.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Inserts processing on a communication object after it transitions to the faulted state due to the FaultAsync operation.
Inserts processing on a communication object after it transitions to the faulted state due to the FaultAsync operation .
protected virtual async Task OnFaulted(CancellationToken token = default(CancellationToken))
        {
            await this.semaphore.WaitAsync(token).ConfigureAwait(false);
            try
            {
                if (this.raisedFaulted)
                {
                    return;
                }
                this.raisedFaulted = true;
            }
            finally
            {
                this.semaphore.Release();
            }
            this.logger?.LogTrace($"Channel faulted.");
            EventHandler faulted = this.Faulted;
            if (faulted != null)
            {
                faulted(this, EventArgs.Empty);
            }
        }
protected virtual async Task OnFaulted ( CancellationToken token = default ( CancellationToken ) ) { await this . semaphore . WaitAsync ( token ) . ConfigureAwait ( false ) ; try { if ( this . raisedFaulted ) { return ; } this . raisedFaulted = true ; } finally { this . semaphore . Release ( ) ; } this . logger ? . LogTrace ( $" Channel faulted. " ) ; EventHandler faulted = this . Faulted ; if ( faulted != null ) { faulted ( this , EventArgs . Empty ) ; } }
Inserts processing on a communication object after it transitions to the faulted state due to the FaultAsync operation.
Inserts processing on a communication object after it transitions to the faulted state due to the FaultAsync operation .
A  representing the asynchronous operation.
A representing the asynchronous operation .
token
CancellationToken
The  that notifies when the task should be canceled.
The that notifies when the task should be canceled .