System.Net.Security.SslState.PartialFrameCallback C# (CSharp) Method

PartialFrameCallback() private static method

private static PartialFrameCallback ( AsyncProtocolRequest asyncRequest ) : void
asyncRequest AsyncProtocolRequest
return void
        private static void PartialFrameCallback(AsyncProtocolRequest asyncRequest)
        {
            if (NetEventSource.IsEnabled) NetEventSource.Enter(null);

            // Async ONLY completion.
            SslState sslState = (SslState)asyncRequest.AsyncObject;
            try
            {
                sslState.StartReadFrame(asyncRequest.Buffer, asyncRequest.Result, asyncRequest);
            }
            catch (Exception e)
            {
                if (asyncRequest.IsUserCompleted)
                {
                    // This will throw on a worker thread.
                    throw;
                }

                sslState.FinishHandshake(e, asyncRequest);
            }
        }