Login Page - Create Account

DTC Protocol Discussion Forum


Date/Time: Thu, 24 Sep 2020 01:59:14 +0000


Google Protocol Buffers

[2016-06-21 07:26:42]
User266748 - Posts: 4 | Ending Date: 2016-06-27 [Expired]
Hi,

Was wondering if you've had chance to update the DTC Google Protocol Buffer .proto file to be compatiable with version 3 of the protocol buffer?

Get a couple of errors when trying to using at as the input to protoc.exe

DTCProtocol.proto: The first enum value must be zero in proto3.

DTCProtocol.proto:397:18: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.

Could potentially fix it myself but unsure of any impact on DTC (using Sierra Charts as the server) it would have if changed to order of the numbering in the enums?

Thanks
[2016-06-21 10:58:16]
DTC Engineering - Posts: 288 | Ending Date: 2015-09-08 [Expired]
We can make the necessary changes. But we are not sure if using version 3 of the protocol buffer compiler is going to be compatible with the DTC server which is using version 2.

We do not think the changes in and of themselves should cause a problem but maybe using version 3 would?
[2016-06-21 19:42:15]
User266748 - Posts: 4 | Ending Date: 2016-06-27 [Expired]
Thanks for the quick response. I'm unsure if using version 3 would present problems, the reason for wanting to use it is that it natively supports c#. There was a port of version 2 which Google have now integrated into the main repository and taken development for. Sounds like from your other post that you expect version 3 to be compatiable though?
[2016-06-23 00:51:51]
DTC Engineering - Posts: 288 | Ending Date: 2015-09-08 [Expired]
Here is the protocol buffers version 3 header file:
http://dtcprotocol.org/DTC_Files/DTCProtocol.3.proto


Let us know if it compiles without errors and if it works properly with the DTC server in Sierra Chart.
[2016-10-17 13:14:06]
DabbaDo - Posts: 105 | Ending Date: 2020-12-08
I tried to compile/generate the DTCProtocol.3.proto file attached to post 4 on this thread.
The only error is "The first enum value must be zero in proto3" which occurs because of this:
enum PriceDisplayFormatEnum
{
PRICE_DISPLAY_FORMAT_UNSET = -1;
//The following formats indicate the number of decimal places to be displayed
PRICE_DISPLAY_FORMAT_DECIMAL_0 = 0;
...

I "fixed" it by moving the PRICE_DISPLAY_FORMAT_UNSET = -1; line to the end of the enum. This allows the proto to compile/generate good code, but I haven't tested its operation.
I'm using version 3.1.0 (NuGet package Google.Protobuf.Tools which goes alongside the 3.1.0 Google.Protobuf package).

The zeroes-first requirement is here: https://developers.google.com/protocol-buffers/docs/proto3#enum

FYI,
Dale

BTW, I wonder if you could start including this file under SierraChart\DTC now that google support of proto3 is "official".
Date Time Of Last Edit: 2016-10-17 13:27:47
[2016-10-17 18:36:02]
DTC Engineering - Posts: 288 | Ending Date: 2015-09-08 [Expired]
This change has been made on our side as well:
I "fixed" it by moving the PRICE_DISPLAY_FORMAT_UNSET = -1; line to the end of the enum.


BTW, I wonder if you could start including this file under SierraChart\DTC now that google support of proto3 is "official".
Yes we will start to do this.
[2016-10-23 12:41:12]
DabbaDo - Posts: 105 | Ending Date: 2020-12-08
One more correction to the DTCProtocol.3.proto file that you are now shipping (thank you).

To message SecurityDefinitionResponse, add:

string ExchangeSymbol = 25;

I did a diff vs. DTCProtocol.proto and this seems to be the only discrepancy.

By the way, it might be a good idea to update github again at some point: https://github.com/DTC-protocol/DTC

Thank you very much.
[2016-10-23 22:19:21]
DTC Engineering - Posts: 288 | Ending Date: 2015-09-08 [Expired]
This is now done.

And the DTC github repository has been updated.

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

Login

Login Page - Create Account