Login Page - Create Account

Support Board


Date/Time: Sat, 10 May 2025 09:11:15 +0000



Post From: DTC -> MarketDataRequest 92 bytes instead of 90 bytes

[2016-01-27 09:21:07]
paska.houso - Posts: 7
Thank you for the answer. The MARKET_DATA_REQUEST message is not a real problem, just wanted to let you know.

Data_structure_alignment at each side of the communication chain can happen. But sending data over the wire has to ensure that both ends agree on what's being sent.

You may have chosen BINARY_ENCODING to be a 1:1 representation of what your compiler of choice happens to do with the structures ("pragma pack" is a Microsoft extension even if supported by other compilers like GCC), but this is not what the communication is supposed to deliver.

This is not a complain or rant. I have no issue in adapting my code, but I guess sending the actual "packed/padded" C++ structure over the wire is not delivering (quoting from the docs) what's promised: "... in order to create reliable and plug-and-play interoperability ..."

This link is the one where "Encodings" are defined: http://dtcprotocol.org/#MessageFormatEncoding

For Binary Encoding the following applies: "... messages are encoded using fixed size binary data structures with embedded fixed length strings ...". Since the size relies on a C++ compiler feature, this break compatibility with other languages for which BINARY_ENCODING may be implemented.

Rather than relying on the compiler to do the job, the structures should have "Reserved" fields which do the same job and ensure over the wire compatibility.

And yes I know there is JSON_ENCODING and Google Protocol Buffers, but as it stands "BINARY_ENCODING" is not a protocol, but rather the transmission of a specific C++ compiler structure over the wire.