Opc.Ua.AsyncResultBase.WaitForComplete C# (CSharp) Method

WaitForComplete() public static method

Waits for the operation to complete.
public static WaitForComplete ( IAsyncResult ar ) : void
ar IAsyncResult The result object returned from the Begin method.
return void
        public static void WaitForComplete(IAsyncResult ar)
        {
            AsyncResultBase result = ar as AsyncResultBase;
            
            if (result == null)
            {
                throw new ArgumentException("IAsyncResult passed to call is not an instance of AsyncResultBase.");
            }

            if (!result.WaitForComplete())
            {
                throw new TimeoutException();
            }
        }

Same methods

AsyncResultBase::WaitForComplete ( ) : bool

Usage Example

コード例 #1
0
        /// <summary>
        /// Completes an asynchronous operation to close a communication object.
        /// </summary>
        public void EndClose(IAsyncResult result)
        {
            if (m_wcfBypassChannel != null)
            {
                m_wcfBypassChannel.EndClose(result);
                return;
            }

            AsyncResultBase.WaitForComplete(result);
            CloseChannel();
        }
All Usage Examples Of Opc.Ua.AsyncResultBase::WaitForComplete