DTC Protocol Discussion Forum
- DTC Protocol Discussion Forum |
- Search Board |
- Control Panel |
- View My Posts / Threads |
- Direct Messages
Date/Time: Fri, 29 Nov 2024 12:56:13 +0000
[BUG] SierraChart as DTC client uses 6 more bytes in MarketDataUpdateTrade
View Count: 2342
[2021-03-21 17:14:45] |
maxima120 - Posts: 144 |
The latest files for binary encoding has version 8 and MarketDataUpdateTrade declared like this: struct s_MarketDataUpdateTrade
{ uint16_t Size; uint16_t Type; uint32_t SymbolID; AtBidOrAskEnum AtBidOrAsk; double Price; double Volume; t_DateTimeWithMilliseconds DateTime; which is 34 bytes. but latest sierra chart connected as a DTC client to my DTC server expects 40 bytes (found it by tinkering for 2hrs).. this is working: 28 00 6b 00 01 00 00 00 02 00 00 00 00 00 00 00 04 03 02 01 00 76 a7 40 00 00 00 00 00 76 a7 40 8f c2 85 cb e1 15 d8 4 |<------------->| these 6 bytes between AtBidOrAsk and Price fields are not in the c++ files and idk what they are this is supposed to work but doesnt: 22 00 6b 00 01 00 00 00 02 00 00 00 00 00 00 76 a7 40 00 00 00 00 00 40 59 40 89 41 50 80 de 15 d8 41
I am sure I set version to 8 on the handshake. So either SC is still running a different version or there is a bug in the message processing in SC. log: DTC - Sub Instance | Connecting to the server 127.0.0.1. Port 30002 | 2021-03-21 17:18:13.234 DTC Client socket (1) | Creating socket. | 2021-03-21 17:18:13.234 DTC Client socket (1) | New receive buffer size: 5242880 | 2021-03-21 17:18:13.234 DTC Client socket (1) | Connecting to IP: 127.0.0.1. | 2021-03-21 17:18:13.234 DTC - Sub Instance | Network connection to server complete. | 2021-03-21 17:18:13.237 DTC - Sub Instance | Starting socket receive thread. | 2021-03-21 17:18:13.237 DTC - Sub Instance | Sending encoding request to server: Binary VLS. Compression: none | 2021-03-21 17:18:13.237 DTC - Sub Instance | Setting DTC encoding to Binary | 2021-03-21 17:18:13.273 DTC - Sub Instance | Sending logon request message. | 2021-03-21 17:18:13.273 DTC - Sub Instance | Received logon response. | 2021-03-21 17:18:13.275 DTC - Sub Instance | Server Name: Test. | 2021-03-21 17:18:13.275 DTC - Sub Instance | Server protocol version: 8. Client protocol version: 8 | 2021-03-21 17:18:13.275 DTC - Sub Instance | Successfully connected. OK. | 2021-03-21 17:18:13.275 DTC - Sub Instance | Trading is not supported. | 2021-03-21 17:18:13.275 DTC - Sub Instance | Symbol and Exchange Delimiter: - | 2021-03-21 17:18:13.275 DTC - Sub Instance | Connected to server complete. | 2021-03-21 17:18:13.275 Question - can you fix this? what these 6 bytes are for? Date Time Of Last Edit: 2021-03-21 17:20:41
|
[2021-04-13 10:40:10] |
norvik_ - Posts: 106 |
DTC namespace uses 8 - byte alignment for all structures. So, it is impossible for any object has 34 bytes size. If it is more than 32, will be 40 bytes. See #32 of DTC.h #pragma pack(push, 8) |
[2021-04-18 02:30:42] |
DTC Engineering - Posts: 320 |
Yes, this is due to structure member alignment.
|
To post a message in this thread, you need to log in with your Sierra Chart account: