Esempio n. 1
0
 private static void OnGetTokenCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         bool webRequest;
         HttpsChannelFactory.HttpsRequestChannel.GetWebRequestAsyncResult asyncState = (HttpsChannelFactory.HttpsRequestChannel.GetWebRequestAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.OnGetToken(result);
             webRequest = asyncState.GetWebRequest();
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             webRequest = true;
             exception  = exception2;
         }
         if (webRequest)
         {
             asyncState.Complete(false, exception);
         }
     }
 }
Esempio n. 2
0
 private static void OnGetBaseWebRequestCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         HttpsChannelFactory.HttpsRequestChannel.GetWebRequestAsyncResult asyncState = (HttpsChannelFactory.HttpsRequestChannel.GetWebRequestAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.request = asyncState.httpsChannel.EndBaseGetWebRequest(result);
             HttpTransportSecurityHelpers.AddServerCertMapping(asyncState.request, asyncState.to);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         asyncState.Complete(false, exception);
     }
 }