Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 01:14:04 +0000



ACSIL sc.ServerConnectionState behavior

View Count: 847

[2016-03-04 15:39:26]
William O - Posts: 16
I have a study that is monitoring if the sc.ServerConnectionState is not connected. However, when the trade / data service disconnects, the subsequent call to the study still shows the ServerConnectionState == SCS_CONNECTED. I cannot detect if the trade service is disconnected until it is connected again. Please see this example for an illustration:

  
int lastValue = sc.GetPersistentInt(10);

  //Check if there was a change in the server state
  if (lastValue != sc.ServerConnectionState)
  {
    //write to log if not connected to trade / data service
    if (sc.ServerConnectionState != SCS_CONNECTED)
    {
      sc.AddMessageToLog("*************** NOT CONNECTED TO TRADE/DATA SERVICE *******************", 1);
    }
  }

  //save the current server state
sc.SetPersistentInt(10, sc.ServerConnectionState);

If you have this in a study and disconnect from a data / trade service you will not see the log message until after you reconnect. I was expecting to see this message as soon as the trade service disconnects.

Please let me know if this is intended behavior or if I'm missing something. In my code I need to know when the trade service disconnects. Thanks in advance!
[2016-03-04 19:33:11]
Sierra Chart Engineering - Posts: 104368
Not sure why we were not aware of this problem until now.

We are correcting this and it will be solved in the next release coming out later today.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account