Esempio n. 1
0
        private void OnWebRequestAgentHelperError(object sender, WebRequestAgentHelperErrorEventArgs e)
        {
            m_Helper.Reset();
            m_Task.Status = WebRequestTaskStatus.Error;

            WebRequestAwaitEventArgs webRequestAwaitEventArgs = WebRequestAwaitEventArgs.Create(m_Task.SerialId, m_Task.WebRequestUri, null, e.ErrorMessage, WebRequestCallBackStatus.Failed);

            m_Task.AsyncAction?.Invoke(webRequestAwaitEventArgs);

            ReferencePool.Release(webRequestAwaitEventArgs);

            m_Task.Done = true;
        }
Esempio n. 2
0
        private void OnWebRequestAgentHelperComplete(object sender, WebRequestAgentHelperCompleteEventArgs e)
        {
            m_Helper.Reset();
            m_Task.Status = WebRequestTaskStatus.Done;

            WebRequestAwaitEventArgs webRequestAwaitEventArgs = WebRequestAwaitEventArgs.Create(m_Task.SerialId, m_Task.WebRequestUri, e.GetWebResponseBytes(), null, WebRequestCallBackStatus.Success);

            m_Task.AsyncAction?.Invoke(webRequestAwaitEventArgs);

            ReferencePool.Release(webRequestAwaitEventArgs);

            m_Task.Done = true;
        }