Hi, I have a method that i just want the answer after 20 seconds. I'm using 
a thread.sleep() in c# to make the program wait, but the problem is when i 
do this ALL my other methods waits too, but i have other methods doing 
another things in the same time that can't be stopped.
was i clear ?? sorry about the english.

A example of the code.

    #region Obter as novas ações
    /// <summary>
    /// É executado de 20 em 20 segundos para verificar as novas ações.
    /// </summary>
    /// <returns>Retorna as novas ações.</returns>
    [AjaxPro.AjaxMethod()]
    public string ObterNovasAcoes()
    {
      try
      {
        int QtdTempo = 0;
        string NovasAcoesTemp = Msn.NovasAcoes;
        while ((NovasAcoesTemp == null) && (QtdTempo++ < 20))
        {
          Thread.Sleep(1000);
          NovasAcoesTemp = Msn.NovasAcoes;
        }
        return NovasAcoesTemp;
      }
      catch (Exception Ex)
      {
        Logger.Erro(null, Ex.Message + " URL: " + Ex.StackTrace);
        return null;
      }
    }
    #endregion


Luciano Sampaio Martins de Souza
Ciência da Computação - UNIT


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/

The open source project is now located at 
http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxPro
-~----------~----~----~----~------~----~------~--~---

Reply via email to