Пример #1
0
 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);
         }
     }
 }