Support Board
Date/Time: Tue, 26 Nov 2024 03:29:56 +0000
Post From: Invalid AccountBalanceUpdate Json message received from DTC Server
[2024-01-18 13:43:23] |
User218244 - Posts: 21 |
I am using a standard Windows socket for IPC with the Sierra Chart DTC Server. Each Json message is simply read from the socket until a null terminator (numeric zero byte) is encountered. As this issue has happened twice, with the message terminating early exactly after "RecalculateDailyLossLimit: Yes", at different positions in the "Cash balance adjustment" Json message (of lengths 649 and 673), the most likely explanation to me is that a null terminator is inadvertently being send by the DTC Server after the "RecalculateDailyLossLimit: Yes" part of the message. One possibility, for example, is related to the fact that in the DTCProtocol.h file the InfoText is defined as being of 96 characters length: const int32_t TEXT_DESCRIPTION_LENGTH = 96;
... char InfoText[TEXT_DESCRIPTION_LENGTH] = {}; whereas the actual partial InfoText received in the above messages were of length 289 and 304, respectively, indicating a possible overflow into memory set to zero. Another possibility is that the entire InfoText string is being encoded into the "Cash balance adjustment" Json message, including its own string null terminator. There are, of course, many other possibilities of how a numeric zero byte could inadvertently be in the Json InfoText value. Date Time Of Last Edit: 2024-01-18 13:54:08
|