Example #1
0
        public void StartProcess(ProcessWebSocket handler, string tarea, ref RespuestaSometer400 pro)
        {
            Thread.Sleep(1000);

            for (int i = 0; i < 2; i++)
            {
                if (System.Web.HttpContext.Current.Application["APIBRINSA_" + tarea] != null)
                {
                    pro = (RespuestaSometer400)System.Web.HttpContext.Current.Application["APIBRINSA_" + tarea];
                    //System.Web.HttpContext.Current.Application["APIBRINSA_" + tarea] = null;
                    i = 2;
                    DemoEventArgsP e = new DemoEventArgsP()
                    {
                        Handler = handler,
                        Message = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm") + " => " + tarea + " " + pro.TKEYWORD + " " + pro.TAPIRESULT + "."
                    };
                    this.OnSendToClient(e);
                    break;
                }
                else
                {
                    i = 0;
                    DemoEventArgsP e = new DemoEventArgsP()
                    {
                        Handler = handler,
                        //DateTime.UtcNow.ToString("MM/dd/yyyy HH:mm:ss fffffff")
                        Message = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm") + " => " + tarea + " Procesando ..., "
                    };
                    this.OnSendToClient(e);
                    Thread.Sleep(2000);
                }
            }
        }
Example #2
0
 protected virtual void OnSendToClient(DemoEventArgsP e)
 {
     this.SendToClient?.Invoke(this, e);
 }
Example #3
0
 private void SendToClientMessage(object sender, DemoEventArgsP e)
 {
     e.Handler.Send(e.Message);
 }