Author Topic: Display an alert when a Statistic on StatServer doesn't exist  (Read 2632 times)

Offline Harifidy

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
Display an alert when a Statistic on StatServer doesn't exist
« on: November 19, 2021, 07:52:53 AM »
Hi,
I am building an app which writes in a file statistics.
I would like to know if there is a way to display to the user if a statistic he requested doesn't exist (for example he chose a stat type which is not correspond to an Agent)
Because when the statistic doesn't exist, the handler "StatServer_Received_Handler" is not called, and nothing happen.
[code]
...
  Endpoint statServerEndpoint = new Endpoint(statServerHost, statServerPort);
  statServer = new StatServerProtocol(statServerEndpoint);
  statServer.Received += StatServer_Received_Handler;
...


private static void StatServer_Received_Handler(object sender, EventArgs e)
        {
          // write the stat in a file
        }

[/code]

I really appreciate our help.
Thank you.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Display an alert when a Statistic on StatServer doesn't exist
« Reply #1 on: November 19, 2021, 01:13:23 PM »
Because it is not an error, it is a miss configuration.
Therefore, no alerts or whatsoever. StatServer just tries to execute but nothing happens.