Beispiel #1
0
/// <summary>
/// The client side implementation of the Begin_NAME_ service contract.
/// </summary>
    public IAsyncResult Begin_NAME_(_NAME_Message request, AsyncCallback callback, object asyncState)
    {
        UaChannelAsyncResult asyncResult = new UaChannelAsyncResult(Channel, callback, asyncState);

        lock (asyncResult.Lock)
        {
            asyncResult.InnerResult = asyncResult.Channel.Begin_NAME_(request, asyncResult.OnOperationCompleted, null);
        }

        return(asyncResult);
    }
Beispiel #2
0
            /// <summary>
            /// Checks for a valid IAsyncResult object and waits for the operation to complete.
            /// </summary>
            /// <param name="ar">The IAsyncResult object for the operation.</param>
            /// <returns>The oject that </returns>
            public static new UaChannelAsyncResult WaitForComplete(IAsyncResult ar)
            {
                UaChannelAsyncResult asyncResult = ar as UaChannelAsyncResult;

                if (asyncResult == null)
                {
                    throw new ArgumentException("End called with an invalid IAsyncResult object.", nameof(ar));
                }

                if (!asyncResult.WaitForComplete())
                {
                    throw new ServiceResultException(StatusCodes.BadTimeout);
                }

                return(asyncResult);
            }
Beispiel #3
0
/// <summary>
/// The client side implementation of the End_NAME_ service contract.
/// </summary>
    public _NAME_ResponseMessage End_NAME_(IAsyncResult result)
    {
        UaChannelAsyncResult asyncResult = UaChannelAsyncResult.WaitForComplete(result);

        return(asyncResult.Channel.End_NAME_(asyncResult.InnerResult));
    }