UaClient/ServiceModel/Ua/Channels/CommunicationObject.cs
/// <summary>
/// Causes a communication object to transition from its current state into the faulted state.
/// </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>
Causes a communication object to transition from its current state into the faulted state.
Causes a communication object to transition from its current state into the faulted state .
protected async Task FaultAsync(CancellationToken token = default(CancellationToken))
        {
            await this.semaphore.WaitAsync(token).ConfigureAwait(false);
            try
            {
                if (this.State == CommunicationState.Closed || this.State == CommunicationState.Closing)
                {
                    return;
                }
                if (this.State == CommunicationState.Faulted)
                {
                    return;
                }
                this.State = CommunicationState.Faulted;
            }
            finally
            {
                this.semaphore.Release();
            }
            await this.OnFaulted(token).ConfigureAwait(false);
        }
protected async Task FaultAsync ( CancellationToken token = default ( CancellationToken ) ) { await this . semaphore . WaitAsync ( token ) . ConfigureAwait ( false ) ; try { if ( this . State == CommunicationState . Closed || this . State == CommunicationState . Closing ) { return ; } if ( this . State == CommunicationState . Faulted ) { return ; } this . State = CommunicationState . Faulted ; } finally { this . semaphore . Release ( ) ; } await this . OnFaulted ( token ) . ConfigureAwait ( false ) ; }
Causes a communication object to transition from its current state into the faulted state.
Causes a communication object to transition from its current state into the faulted state .
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 .