If I remember well, you can cast the response as an EventInfo object… I’ll try to find my old codes experimenting on this to give a better response.
Edit:
I used something like this (on Java):
StatServerProtocol primaryStatServer = new StatServerProtocol(primary, primaryConnectTimeout);
primaryStatServer.setMessageHandler(statHandler);
...
...
private MessageHandler statHandler = new MessageHandler() {
@Override
public void onMessage(Message message) {
if (null == message) return;
if (message.messageName().equalsIgnoreCase("EventInfo")) {
EventInfo ev = (EventInfo) message;
metric.setLastMetricValue(ev.getIntValue());
}
}
};
In the code above, every time I get a message of type EventInfo from StatServer, I update my own internal object “metric” with the stat value by using the .getIntValue() method.
Ah, I just now realized you were getting the DN State. Try cast your StateValue as DNStatus and then get the Actions property to check if it suits what you need
System.InvalidCastException was unhandled by user code
HResult=-2147467262
Message=Unable to cast object of type ‘Genesyslab.Platform.Reporting.Protocols.StatServer.AgentStatus’ to type ‘Genesyslab.Platform.Reporting.Protocols.StatServer.DnStatus’.