FinishHandshake() private method

private FinishHandshake ( Exception e, AsyncProtocolRequest asyncRequest ) : void
e Exception
asyncRequest AsyncProtocolRequest
return void
Example #1
0
 private static void WriteCallback(IAsyncResult transportResult)
 {
     if (!transportResult.CompletedSynchronously)
     {
         AsyncProtocolRequest asyncState  = (AsyncProtocolRequest)transportResult.AsyncState;
         SslState             asyncObject = (SslState)asyncState.AsyncObject;
         try
         {
             asyncObject.InnerStream.EndWrite(transportResult);
             object    obj2      = asyncState.AsyncState;
             Exception exception = obj2 as Exception;
             if (exception != null)
             {
                 throw exception;
             }
             asyncObject.CheckCompletionBeforeNextReceive((ProtocolToken)obj2, asyncState);
         }
         catch (Exception exception2)
         {
             if (asyncState.IsUserCompleted)
             {
                 throw;
             }
             asyncObject.FinishHandshake(exception2, asyncState);
         }
     }
 }
Example #2
0
        private static void PartialFrameCallback(AsyncProtocolRequest asyncRequest)
        {
            SslState asyncObject = (SslState)asyncRequest.AsyncObject;

            try
            {
                asyncObject.StartReadFrame(asyncRequest.Buffer, asyncRequest.Result, asyncRequest);
            }
            catch (Exception exception)
            {
                if (asyncRequest.IsUserCompleted)
                {
                    throw;
                }
                asyncObject.FinishHandshake(exception, asyncRequest);
            }
        }
Example #3
0
        private static void ReadFrameCallback(AsyncProtocolRequest asyncRequest)
        {
            SslState asyncObject = (SslState)asyncRequest.AsyncObject;

            try
            {
                if (asyncRequest.Result == 0)
                {
                    asyncRequest.Offset = 0;
                }
                asyncObject.ProcessReceivedBlob(asyncRequest.Buffer, asyncRequest.Offset + asyncRequest.Result, asyncRequest);
            }
            catch (Exception exception)
            {
                if (asyncRequest.IsUserCompleted)
                {
                    throw;
                }
                asyncObject.FinishHandshake(exception, asyncRequest);
            }
        }