Which API can I use to get device status?

I want to get that if the device is off-line or on-line from milestone server.which API can i use to get?

The methods used in the StatusViewer sample subscribe to events in the Event Server to know if cameras are responding or not responding. This is what I usually recommend. Works for all XProtect products.

An alternative that will work for XProtect Corporate, Expert and Plus versions is to use the Status Soap Protocol. Samples showing this are Status Console, Status Session Console, System Status Client Console

when I use ​TransmitMessage API in Management Client,when I refresh the node, this API is locked. Before refresh ,it is OK. Can you give me some suggest?

Do you get any form of exception or similar?

Can you explain the flow, when and where do you make the TransitMessage?

Are you in the UI thread or in another thread?

MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);

  \_messageCommunication = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);

  // Register to receive the response from the ProvideCurrentStateRequest - issued later in this method.

  \_obj3 = \_messageCommunication.RegisterCommunicationFilter(ProvideCurrentStateResponseHandler,

    new VideoOS.Platform.Messaging.CommunicationIdFilter(MessageCommunication.ProvideCurrentStateResponse));

  try

  {

    //if (\_messageCommunication.IsConnected)

    //{

      VideoOS.Platform.Messaging.Message msg = new VideoOS.Platform.Messaging.Message(MessageCommunication.ProvideCurrentStateRequest);

      // Ask for current state of all Items

      \_messageCommunication.TransmitMessage(msg, null, null, null);

    //}

    //else

    //{

     // return false;

    //}

  }

this is my code. and I call this code in UI thread . now i use IsConnected Filed to solve the block .but when i refresh the node in management client. this Filed will give me false. So i need to start a thread to call this function by cycle util this filed is true.

TransmitMessage will take the time to deliver the message to the Event Server before returning, if on the UI thread everything will lock, especially in error situation the wait could be too much. Ideally you should let a background thread handle this.