Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 00:18:38 +0000



DTC Protobuffer server parsing error

View Count: 1103

[2015-12-06 16:51:16]
Guilherme - Posts: 66
I'm implementing a DTC server using Protocol Buffer. I'm getting error in the very first message I receive from SierraChart when it starts the connection. The message, as defined in the protocol, is the EncodingRequest. I receive the whole 16 bytes and read the 4 bytes header correctly, which is: 16 bytes size, and type 6 message. The following data I send to Protobuffer parsing, which crashes and sends me a Invalid Tag message. I'm using the last .proto file you provide in Github, and generated my code files with protobuf version 2.6.1 . I've attached a picture with the data I receive for this very first message.

Is this encoding already stable?
imageDTC-EncodingRequest-2015-12-06_14-38-25.png / V - Attached On 2015-12-06 16:45:54 UTC - Size: 35.07 KB - 260 views
[2015-12-06 18:33:59]
Guilherme - Posts: 66
I think I found the problem. It looks like Sierra Chart is sending the EncodingRequest in BINARY_ENCODING, even when I set the connection in Sierra to use Protocol Buffers as the primary connection encoding. Is it the expected behavior?
[2015-12-06 21:26:11]
Sierra Chart Engineering - Posts: 104368
Yes you got it. And for the last 30 minutes we have been discussing this to determine what is the best protocol for DTC to handle the encoding request. We still have not come to a final decision.

Basically the Client and the Server have a default encoding and that needs to be known on each side.

When you set the Primary Connection Encoding in Sierra Chart for the DTC Client to Google Protocol Buffers, Sierra Chart assumes the server is using Binary Encoding as the default since all of our own servers use that as the default. Therefore, it sends the encoding request using Binary Encoding.
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
[2015-12-06 21:37:09]
Guilherme - Posts: 66
Thank you very much for your rapid response. Now I got a problem with the expected message Sierra would send to server after getting an ENCODING_RESPONSE message. I would expect a LOGON_REQUEST from Sierra, but for some reason it keeps sending one ENCODING_REQUEST every 5 seconds. Is there a way to change the status of the message log window to show more detail, as if it were a debug message window?
[2015-12-06 22:10:10]
Sierra Chart Engineering - Posts: 104368
Is your server responding to the Encoding Request? It must.

. I would expect a LOGON_REQUEST from Sierra, but for some reason it keeps sending one ENCODING_REQUEST every 5 seconds.
This could not be. Sierra Chart will send the Encoding Request and if it does not receive a response after 20 seconds, the connection is closed. You will see an indication of this in the Message Log.

A new connection will occur five seconds later. This must be what you are seeing.

We have added a new message to the Message Log when the encoding request is sent. However, there already is more than sufficient messages to have an understanding of what is going on. If you post the Message Log we can explain what we see.
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
Date Time Of Last Edit: 2015-12-06 22:12:11
[2015-12-06 22:22:12]
Guilherme - Posts: 66
I do send a Encoding Response, but in protocol buffer format. I think I got the same problem here. Even if my server accepts just protocol buffer messages, I have to send to Sierra a Encoding Response in binary. And so the following messages will use just the protocol buffer format. Is this correct? I think the doc is a little bit confusing in this topic.
[2015-12-06 22:54:41]
Sierra Chart Engineering - Posts: 104368
The Encoding Response must be sent using Binary Encoding because that is what the current encoding is on the client-side until it is told otherwise.

The documentation has not been entirely clear on this entire subject but we are making it more clear now.

However, the documentation does currently state this:
In either case, the ENCODING_RESPONSE is sent using the current Server encoding and all subsequent messages are sent using the new encoding if it was accepted.

Reference:
http://dtcprotocol.org/index.php?page=doc/doc_DTCMessageDocumentation.php#EncodingRequest
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
Date Time Of Last Edit: 2015-12-06 22:55:18

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

Login

Login Page - Create Account