Brunet.Simulator.Tasks.AllToAll.Callback C# (CSharp) Method

Callback() protected method

protected Callback ( object o, EventArgs ea ) : void
o object
ea System.EventArgs
return void
    protected void Callback(object o, EventArgs ea)
    {
      Channel q = o as Channel;
      try {
        RpcResult res = (RpcResult) q.Dequeue();
        int result = (int) res.Result;
        if(result != 0) {
          throw new Exception(res.Result.ToString());
        }

        long end_time = DateTime.UtcNow.Ticks / TimeSpan.TicksPerMillisecond;
        long latency = end_time - _start_time;
        LatenciesInMs.Add((int) latency);
      } catch(Exception e) {
        Console.WriteLine(e);
      }

      if(--_waiting_on == 0) {
        Finished();
      }
    }