static void OnAuthenticateAsClient(IAsyncResult result)
        {
            if (result.CompletedSynchronously)
            {
                return;
            }

            StreamSecurityUpgradeInitiatorAsyncResult thisPtr =
                (StreamSecurityUpgradeInitiatorAsyncResult)result.AsyncState;

            Exception completionException = null;

            try
            {
                thisPtr.CompleteAuthenticateAsClient(result);
            }
#pragma warning suppress 56500 // Microsoft, transferring exception to another thread
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }

                completionException = e;
            }
            thisPtr.Complete(false, completionException);
        }
Ejemplo n.º 2
0
 private static void OnAuthenticateAsClient(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         StreamSecurityUpgradeInitiatorAsyncResult asyncState = (StreamSecurityUpgradeInitiatorAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.CompleteAuthenticateAsClient(result);
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         asyncState.Complete(false, exception);
     }
 }