System.Net.LazyAsyncResult.InternalWaitForCompletion C# (CSharp) Method

InternalWaitForCompletion() private method

private InternalWaitForCompletion ( ) : object
return object
        internal object InternalWaitForCompletion()
        {
            return WaitForCompletion(true);
        }

Usage Example

Beispiel #1
0
        public override WebResponse EndGetResponse(IAsyncResult asyncResult)
        {
            GlobalLog.Enter("FileWebRequest::EndGetResponse");

            WebResponse response;
            bool        success = false;

            try {
                LazyAsyncResult ar = asyncResult as LazyAsyncResult;
                if (asyncResult == null || ar == null)
                {
                    Exception e = asyncResult == null? new ArgumentNullException("asyncResult"): new ArgumentException(SR.GetString(SR.InvalidAsyncResult), "asyncResult");
                    GlobalLog.LeaveException("FileWebRequest::EndGetRequestStream", e);
                    throw e;
                }


                object result = ar.InternalWaitForCompletion();
                if (result is Exception)
                {
                    throw (Exception)result;
                }
                response      = (WebResponse)result;
                m_readPending = false;
                success       = true;
            } catch (Exception exception) {
                if (Logging.On)
                {
                    Logging.Exception(Logging.Web, this, "EndGetResponse", exception);
                }
                throw;
            } finally {
                GlobalLog.Leave("FileWebRequest::EndGetResponse");

                // there is no statusCode in FileWebRequest object, defaulting it to zero.
                if (FrameworkEventSource.Log.IsEnabled())
                {
                    LogEndGetResponse(success, synchronous: false, statusCode: 0);
                }
            }

            return(response);
        }
All Usage Examples Of System.Net.LazyAsyncResult::InternalWaitForCompletion