Sending protobuf msg with checksum using CodeedOutputStrem over gRPC

404 views
Skip to first unread message

Yariv Hashai

unread,
Nov 16, 2020, 11:39:34 AM11/16/20
to Protocol Buffers
Hello, 

I would like to add a checksum to my protobuf msg, as i understood its is possible by using CodeedOutputStrem and write the msg bytes and append a fix sized checksum 

While creating this binary stream, i would like to send it to another endpoint via gRPC

I was thinking about creating another protobuf msg and rpc which will be something like that:

message confWithChecksum {
string bytes = 1;  // this bytes will hold the conf + checksum appnded 
}

The only issue that i have to desirialze the msg twice  - for the the confWithChecksum msg and once for the actuatl conf msg after triming the checksum bytes.

Is there another elegant way of doing it? is there a way to use the grpc and just streaming bytes?

Nadav Samet

unread,
Nov 16, 2020, 12:00:37 PM11/16/20
to Yariv Hashai, Protocol Buffers
You can send the checksum as a Metadata header.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/47043568-3b53-4d2d-836c-a0102a4a903dn%40googlegroups.com.


--
-Nadav
Message has been deleted

Nadav Samet

unread,
Nov 16, 2020, 12:38:15 PM11/16/20
to Yariv Hashai, Protocol Buffers
Hi Yariv, I am not sure what library you are referring to in "ver 2.6". If it's about protobuf 2.6.x, then metadata is a grpc concept, which is independent of the protobuf version being used.

On Mon, Nov 16, 2020 at 9:33 AM <551...@gmail.com> wrote:
Nice! thanks for that, is that supported also in ver 2.6?

ב-יום שני, 16 בנובמבר 2020 בשעה 19:00:37 UTC+2, thes...@gmail.com כתב/ה:


--
-Nadav

551...@gmail.com

unread,
Nov 16, 2020, 12:43:24 PM11/16/20
to Protocol Buffers
Yep just figure it out, was removing the comment, thanks for the help!

ב-יום שני, 16 בנובמבר 2020 בשעה 19:38:15 UTC+2, thes...@gmail.com כתב/ה:
Reply all
Reply to author
Forward
0 new messages