Exemplo n.º 1
0
        private void button4_Click(object sender, EventArgs ea)
        {
          var CNT = edRepeat.Text.AsInt();
         
          var client = new JokeContractClient(cbo.Text);
          
         // client.ReserveTransport = true;
          var w = Stopwatch.StartNew();
          int i = 0;
          try
          {
            for(; i<CNT; i++)
              client.Notify("Notify!");

            w.Stop();
            Text = "Notified  "+CNT.ToString()+" in " + w.ElapsedMilliseconds + " ms";
          }
          catch (Exception e)
          {
            Text = string.Format("After {0} times: {1}", i, e.ToMessageWithType());
          }          

          client.Dispose();
        }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs ea)
        {
          NOTIFY_COUNT++;

          var client = new JokeContractClient(cbo.Text);

          try
          {
            client.Notify("Notify!");
            Text = "Notified " + NOTIFY_COUNT.ToString() + " times";
          }
          catch (Exception e)
          {
            Text = e.ToMessageWithType();
          }          
         
          client.Dispose();
        }