System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.AuthenticateContinueCallback C# (CSharp) Method

AuthenticateContinueCallback() private static method

private static AuthenticateContinueCallback ( IAsyncResult result ) : void
result IAsyncResult
return void
            private static void AuthenticateContinueCallback(IAsyncResult result)
            {
                if (!result.CompletedSynchronously)
                {
                    ConnectAndHandshakeAsyncResult thisPtr = (ConnectAndHandshakeAsyncResult)result.AsyncState;
                    try
                    {
                        LineInfo info = AuthCommand.EndSend(result);
                        if ((int)info.StatusCode == 235)
                        {
                            thisPtr._connection._authenticationModules[thisPtr._currentModule].CloseContext(thisPtr._connection);
                            thisPtr._connection._isConnected = true;
                            thisPtr.InvokeCallback();
                            return;
                        }
                        else if ((int)info.StatusCode == 334)
                        {
                            thisPtr._authResponse = info.Line;
                            if (!thisPtr.AuthenticateContinue())
                            {
                                return;
                            }
                        }
                        thisPtr.Authenticate();
                    }
                    catch (Exception e)
                    {
                        thisPtr.InvokeCallback(e);
                    }
                }
            }
        }