Re: [protobuf] A first chance exception of type 'System.IO.EndOfStreamException' occurred in protobuf-net.DLL

2014-04-23 Thread Marc Gravell
This looks to be protobuf-net specific. Note that protobuf-net includes SerializeWithLengthPrefix and DeserializeWithLengthPrefix which can be used to simplify working with multiple separate logical messages on a single stream (such as against a socket), without ever over-reading. Also - it

Re: [protobuf] I don't understand why we use protocol buffer

2014-05-07 Thread Marc Gravell
Protocol buffers in the public project consists primarily of the serialization framework; serialization is always necessary when communicating, and frameworks/formats are aplenty, including xml, json, etc. The primary features of protocol buffers (protobuf) are: - efficient binary on the wire

Re: [protobuf] Use different encoding while serializing strings

2014-05-15 Thread Marc Gravell
protobuf is a binary-safe protocol, and is not impacted by contents such as \r, \n or \t. In particular, text content is utf-8 encoded and length-prefixed - it simply *does not care* what is inside the text. I suspect any problem you are having relates to how you are transporting and processing

Re: [protobuf] What causes TargetInvocationException during serialization

2014-05-16 Thread Marc Gravell
Oops, meant to reply-all! On 16 May 2014 19:34, Marc Gravell marc.grav...@gmail.com wrote: This is specifically protobuf-net; I have received a repro case from Marco separately via email, so I will investigate and post back here and directly, but short version don't know off the top of my head

Re: [protobuf] ProtoContractAttribute.Name Usage?

2014-05-27 Thread Marc Gravell
Oops; meant to press reply-all, not reply, but: This relates to protobuf-net. The only time the Name property is used is if you reverse-generate from code to .proto via Serializer.GetProto (or the similar method on RuntimeTypeModel). On 23 May 2014 13:23, Sam Eaton nuluv...@gmail.com wrote:

Re: [protobuf] Protobuf-net - list of objects with parent reference

2014-06-09 Thread Marc Gravell
The protobuf specification doesn't have the notion of object identity. protobuf-net *does* (as an optionally enabled feature), but it doesn't currently work for list items directly, although I suspect it probably should. Since it would break the format, though, it would need explicit enabling if I

Re: [protobuf] Re: Issue 269 in protobuf: Would like to have byte or int8 type for the message definition

2014-06-30 Thread Marc Gravell
The simple answer would be use the existing oversized types, and cast at the caller. Varint data in particular will either be 1 byte or 2 (50% each) for byte values. For longer sequences (rgba etc) there are existing fixed-32 and bytes. If the intent is to add a wire type to precisely represent a

Re: [protobuf] [Protobuf] Can protobuf serialize datatable (C#)

2014-07-10 Thread Marc Gravell
sqlcommands. which means we need to serialize DataTables as part of an object. I there a way we can achieve this with protobuf. Do you have any workaround/alternative or suggestion? Regards Desmond Davids On Friday, 16 July 2010 08:00:25 UTC+2, Marc Gravell wrote: From the message

Re: [protobuf] [Protobuf] Can protobuf serialize datatable (C#)

2014-07-11 Thread Marc Gravell
forward to hear from you. Regards Desmond On Thu, Jul 10, 2014 at 9:18 PM, Marc Gravell marc.grav...@gmail.com wrote: Ooh, the idea of allowing SQL over a service boundary sends all kinds of shivers up my back, and not the good kind of shivers. On your head be it, but: I wouldn't do

Re: [protobuf] Protogen and wcf json serialization

2014-07-15 Thread Marc Gravell
This is specifically protobuf-net; firstly, you should be able to add -p:lightFramework to the command - that omits a few things that don't work on all frameworks, including [Serializable] iirc. However, you can also just edit CSharp.xslt to make any necessary changes. Stick it alongside

Re: [protobuf] Newbie here.. pass serializer functions to protobuf-net at runtime?

2014-08-11 Thread Marc Gravell
This is specific to protobuf-net. The library does not currently expose any custom serialization extension point; to do that in a way that is genuinely useful, while not allowing the caller to break the wire format, is quite tricky. To date: it hasn't been necessary. If you can clarify *why* you

Re: [protobuf] Proto-net Deserialization exception

2014-09-12 Thread Marc Gravell
My first thought is: what makes you think that you have read an entire frame of data, and a *single* frame of data? socket read very rarely conveniently forms itself into complete frames. Please see http://tiny.cc/io. My second thought is: you told it to use the *entire* buffer, not just the valo

Re: [protobuf] Deserialization problem with protobuf-net

2014-09-12 Thread Marc Gravell
Also; don't swallow exceptions. In fact, if you can't do anything useful, don't even try/catch - just let it explode. Marc On 12 September 2014 10:44, Antonio Ramos ninira...@gmail.com wrote: Hi all, this is my first time with protobuf protocol and protobuf-net. I have the following

Re: [protobuf] Proto-net Deserialization exception

2014-09-12 Thread Marc Gravell
: But for use this constructor i have to know the message size, is´nt it? how can i do it? with a sizeof of the proto class?? 2014-09-12 21:22 GMT+02:00 Marc Gravell marc.grav...@gmail.com: My first thought is: what makes you think that you have read an entire frame of data, and a *single* frame

Re: [protobuf] How to define Structured Binary file

2014-10-06 Thread Marc Gravell
You cannot. What you describe is not what protobuf offers. On 7 Oct 2014 00:55, RPMASA rudram...@gmail.com wrote: Hi, I have structured binary file specifying size of each element in bytes. How can I mentioned them in ptoto file? No. Description Data Value Variable Type Number of

Re: [protobuf] Null Nested Messages--whats expected?

2014-10-15 Thread Marc Gravell
I can't reproduce this outputting a 0x0; my example is below, and outputs 22-0A-12-08-73-6F-6D-65-43-69-74-79 - the null nested message is simply completely omitted; the contents are: - 2 bytes field-header and length-prefix for the location member - 2 bytes field-header and length-prefix for the

Re: [protobuf] Null Nested Messages--whats expected?

2014-10-15 Thread Marc Gravell
Just for visibility; we've discussed this more on github, and it *looks* to be a protostuff decoding issue, not a protobuf-net encoding issue; Johannes will take our findings to protostuff for further investigation. Arbitrary link is arbitrary:

Re: [protobuf] generate .proto file from C# code

2016-09-12 Thread Marc Gravell
es/download/v3.0.0/protoc-3.0.0-win32.zip> > for > compiler? Can you also give me ur input (.proto file) for that you gout > output *https://gist.github.com/mgravell/4967b490d40f13300919b018af23b282 > . > > Thanks for your time. > > > On Fri, Sep 9, 2016 at 7:08

Re: [protobuf] generate .proto file from C# code

2016-09-09 Thread Marc Gravell
You'd be best off creating it by hand, but if you want a starting point, you can use protobuf-net to get some hints; add [ProtoContract(ImplicitFields = ImplicitFields.AllPublic)] to your root type (UAVState?), and use something like Console.WriteLine(Serializer.GetProto()); to see the content. I

Re: [protobuf] C# oneoof help

2017-07-15 Thread Marc Gravell
the language guide is very clear and explicit that this is intentional; it is nothing to do with the C# part, and will behave the same for any language: > You can add fields of any type, but cannot use the required, optional, or repeated keywords.

Re: [protobuf] Are protobufs serialised canonically?

2017-07-25 Thread Marc Gravell
Formally: no. Practically: almost always You shouldn't **demand** it. Basically, it goes like this: - the spec asks that writers *should* write fields in order - the spec asks that readers *must* allow fields in any order - data can be concatenated as a merge, meaning fields can appear out of

Re: [protobuf] why not 150

2017-07-02 Thread Marc Gravell
can you perhaps clarify the question? On 2 Jul 2017 2:18 p.m., "Jing Lupeng" wrote: > > https://developers.google.com/protocol-buffers/docs/encoding#structure > > > >

[protobuf] Re: How can i get bytes from a serialized message without the refix-length before each field?

2017-08-04 Thread Marc Gravell
(duplicate with existing answers here: https://stackoverflow.com/questions/45501605/is-it-possible-to-use-google-protobuffer-to-serialize-data-without-prefixing-the) -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this

Re: [protobuf] Practical example for protobuf

2017-06-21 Thread Marc Gravell
wow, auto-complete went mad with that, sorry. "nay" => may; "red is" => redis, etc. On 21 Jun 2017 8:22 a.m., "Marc Gravell" <marc.grav...@gmail.com> wrote: > "You wish to express data in a mechanism that can be expressed as a byte > str

Re: [protobuf] Practical example for protobuf

2017-06-21 Thread Marc Gravell
"You wish to express data in a mechanism that can be expressed as a byte stream, and/or communicate that between systems that nay or may not be using different architectures, in a way that is efficient both computationally and in terms of bandwidth; and a platform independent tool to express the

[protobuf] Maps and append-as-merge; expectation clarification please

2017-06-24 Thread Marc Gravell
Basically, if I have message Foo { int32 x = 1; int32 y = 2; } message Bar { map items = 1; } And I serialize 2 fragments appended: items = { 1: { x: 123 } } and (as the second appended chunk) items = { 1: { y: 456 } } And now I deserialize the entire chunk; is the

Re: [protobuf] Re: Practical example for protobuf

2017-06-23 Thread Marc Gravell
javascript (including browsers and node.js) can handle binary data just fine, and my understanding is that this functionality is exposed by the javascript implementation. I can't opine on that hugely, because my use of protobuf is primarily backend - server-to-server, or server<--->storage.

[protobuf] online .proto parser available

2017-05-29 Thread Marc Gravell
Hey all; I've been doing some work with protobuf-net lately to bring it up to date with proto3, "timestamp", and all those things. As part of that, I've been reworking my entire code-gen pipeline, with the result that I accidentally wrote an interactive online editor while I was avoiding

Re: [protobuf] Generating an (C#) Interface and extendable data model from .proto, namespacing and inheritence

2017-05-30 Thread Marc Gravell
I can't speak for the design choices - but *as I understand it*, the key point of protobuf is to enable things to work well cross-platform. That means that at the DTO level, things need to be *possible* to implement in a wide range of languages, and the reality is that not all frameworks would

Re: [protobuf] map support in protobuf version 2

2017-06-13 Thread Marc Gravell
It is supported in the proto2 *language*, but you'll need to use a *proto compiler version* that understands it. Depending on the implementation (i.e. which language and library you are generating for), you *may* also need to use a *library* version that has additional features to support maps.

Re: [protobuf] map support in protobuf version 2

2017-06-13 Thread Marc Gravell
Oops; I meant to reply to group; email is hard... (repeats response) What protoc compiler version are you using? what does protoc --version say? It should be 3.3.0 or similar. The following works fine using protoc (note it defaults to protogen - you'll need to change the drop-down to protoc

[protobuf] Is the extension registry address still monitored?

2017-06-16 Thread Marc Gravell
In descriptor.proto, it asks public authors to request extension numbers (for the DSL) via protobuf-global-extension-regis...@google.com I've done this, but without response. Is this address being monitored? -- You received this message because you are subscribed to the Google Groups

Re: [protobuf] [libprotobuf ERROR google/protobuf/message_lite.cc:118] Can't parse message of type "RegisterWatcherResponse" because it is missing required fields: rc

2017-06-18 Thread Marc Gravell
(I'm assumig the "optional" isn't there in the real example) You can't simply change between proto2 and proto3. In proto3 everything is optional with an implicit zero default. This is fundamentally incompatible with consumers who have a "required" expectation **unless** you happen to never send

[protobuf] Additional tool for ripping apart schema-less protobufs

2017-06-11 Thread Marc Gravell
This will mostly be useful to library maintainers, etc. I know that protoc has some tools in this area, but I found them ... "unhelpful" for my purposes. I very often end up digging through protobuf files of unknown origin without a schema etc, to either help support a stuck user, or to

Re: [protobuf] Transfer actual code with Protobuffers

2017-05-30 Thread Marc Gravell
That's not something that protobuf targets. If you have a syntax that allows you to convey an expression as a string or similar, then by all means do that - but protobuf will just see it as an opaque string. Note that there are usually a range of concerns when transferring executable code (of any

Re: [protobuf] Null String in C# (CheckForNull)

2017-10-03 Thread Marc Gravell
Fields are optional but the implicit default for a string is a zero length string, not a null length string. To be honest, either approach seems perfectly reasonable as long as it is documented and any exception is clear and obvious. For my separate implementation I chose to interpret nulls as

Re: [protobuf] Not able to serialize Object type

2017-10-23 Thread Marc Gravell
I'm assuming this is protobuf-net; the message is right : the library can't work with "object itemField". Perhaps the best thing would be to treat this like a "oneof" (in .proto terms) and have an accessor per possible type. For example: [ProtoMember(n)] private int ValueInt32 {

Re: [protobuf] Not able to serialize Object type

2017-10-23 Thread Marc Gravell
that i should write 4 protomembers for the 4 types? > > best Regards, > Nihar > > > On Mon, Oct 23, 2017 at 9:19 AM, Marc Gravell <marc.grav...@gmail.com> > wrote: > >> I'm assuming this is protobuf-net; the message is right : the library >> can't work with

Re: [protobuf] Not able to serialize Object type

2017-10-23 Thread Marc Gravell
ctober 2017 at 09:48, Marc Gravell <marc.grav...@gmail.com> wrote: > Yes, something like that; example: https://pastebin.com/CUvWz00L > > On 23 October 2017 at 09:38, Nihar Mishra <itnmis...@gmail.com> wrote: > >> Hi Marc, >> Thanks a lot. Yes this is protobuf-ne

Re: [protobuf] How to combine FieldOptions with Default Values in Messages

2017-11-12 Thread Marc Gravell
requested claritication and *possibly* answered here: https://stackoverflow.com/questions/47246474/protobuf-how-to-combine-fieldoptions-with-default-values-in-messages On 12 Nov 2017 7:12 a.m., wrote: > I have an message using FieldOptions but I also want to use default

Re: [protobuf] Upgrading float fields to double

2017-11-15 Thread Marc Gravell
Not really, no. They take different amounts of space on the wire, and have a different declared wire type (header). Some libraries may choose to be gracious and apply the conversion silently, but other libraries could just say "unexpected wire type" and stop processing. You could perhaps do it as

Re: [protobuf] Guid conventions

2017-12-08 Thread Marc Gravell
tion, since string > fields are for UTF-8 only. We could consider eventually creating a > well-known type but I'm not sure how much demand there is for one. > > On Wed, Dec 6, 2017 at 11:46 AM, Marc Gravell <marc.grav...@gmail.com> > wrote: > >> A question on Stack Overf

[protobuf] Guid conventions

2017-12-06 Thread Marc Gravell
A question on Stack Overflow earlier ( https://stackoverflow.com/questions/47674930/google-protobuf-proto-file-query/4767629) reminded me that I'm not fully "up" on the conventions for using guids in protobuf. There's no primitive / keyword for them, and AFAIK no "well known type". So : how do

Re: [protobuf] Validate .proto file in Java

2017-12-06 Thread Marc Gravell
Apparently https://github.com/square/wire/ includes a runtime .proto parser for Java. That might help? It isn't the official one, note. On 6 Dec 2017 8:28 p.m., "Omar Al-Safi" wrote: > Hello folks, > > I stubbled upon a requirements that I receive a textual representation of

Re: [protobuf] Any way to "extract all" using protoc or any other tool?

2017-12-10 Thread Marc Gravell
You can and it does. The problem is that the wire format by itself doesn't tell it **what message type** the root object is. So you need to tell it in the additional parameter to --decode On 10 Dec 2017 3:14 p.m., "Jim Baldwin" wrote: It's not really just a sequence; it's a

Re: [protobuf] Any way to "extract all" using protoc or any other tool?

2017-12-10 Thread Marc Gravell
Rather, this format is a > series of top-level parameters. So, I have to give it the Parameter I’m > looking for. The problem I have with this is the order of parameters > _might_ matter, and I lose that by only looking for one. > > On Dec 10, 2017, at 8:35 AM, Marc Gravell <ma

Re: [protobuf] Any way to "extract all" using protoc or any other tool?

2017-12-10 Thread Marc Gravell
the "root" message is. It > seems like an omission in the whole PB thing that you can't specify the > .proto and do a --decode_everything. > > On Sunday, December 10, 2017 at 8:23:12 AM UTC-8, Marc Gravell wrote: >> >> You can and it does. The problem is tha

Re: [protobuf] Re: Any way to "extract all" using protoc or any other tool?

2017-12-10 Thread Marc Gravell
They are field numbers. They don't mean anything by themselves other than to identify each field. If you want to know the logical *name* of each field, you need the .proto schema. On 10 Dec 2017 4:23 p.m., "Jim Baldwin" wrote: > Perhaps it might help if I understood the

Re: [protobuf] Re: validating protobuf messages

2017-12-10 Thread Marc Gravell
a zero tag is never valid in any protobuf data, although it wouldn't be unheard of for folks to use a zero tag as a sentinel value to demark multiple root messages. Protoc has some facilities to check the insides of a message that might help you figure out how likely it is to be a match, but it

Re: [protobuf] Protobuf3 InvalidProtocolBufferException with some strings

2018-05-17 Thread Marc Gravell
(mainly for the list) see also the stackoverflow question: https://stackoverflow.com/q/50387660/23354 On Thu, 17 May 2018 at 10:42, Alexey Vishnyakov wrote: > Hello > > We using protobuf v.3 to transfer messages from C# client to Java server > over HTTP. > > The message

Re: [protobuf] What is the relation between length of data block and file length in varint?

2018-05-24 Thread Marc Gravell
I wonder if you're decoding it incorrectly. Maybe if you could post the bytes that you're decoding to reach this contradictory result, we can advise you. On Thu, 24 May 2018 at 04:59, Ruman Ahmed Rizvi < ruman.ahmed.rizvi@gmail.com> wrote: > When working with protocol buffers and encoding

Re: [protobuf] What is the relation between length of data block and file length in varint?

2018-05-24 Thread Marc Gravell
I added a much longer version of this here: https://stackoverflow.com/questions/50500626/what-is-the-relation-between-length-of-data-block-and-file-length-in-varint/50503626#50503626 On Thu, 24 May 2018 at 08:33, Marc Gravell <marc.grav...@gmail.com> wrote: > I wonder if you're

Re: [protobuf] first time using protobuf INTERESTING SCENARIO

2018-05-21 Thread Marc Gravell
It would probably help if you could be specific about what is happening now. Have you got as far as running "protoc", or is the problem getting "protoc" ready? If you have "protoc", what command are you using? Are there error messages? If so: what do they say? Do you have an example .proto file?

Re: [protobuf] Reg: ProtocolBuf-net

2017-10-26 Thread Marc Gravell
ine, but I'm stuck on how to display the results on an > aspx page. Any idea please? > > > Le jeudi 27 mai 2010 09:30:03 UTC+3, Marc Gravell a écrit : > >> With "full" .NET to .NET WCF, then switching the serialization layer to >> use protobuf-net can (dependi

Re: [protobuf] Integrate proto2 messages from a device to C#

2017-10-27 Thread Marc Gravell
protobuf-net should work with proto 2 - try here: https://protogen.marcgravell.com On 27 Oct 2017 6:16 p.m., "cleal" wrote: > I have to integrate a third part protocol from a gps device, they send me > the .proto files, they are using the schema proto2. > > I should

Re: [protobuf] Precompiled Version of probuf for VS2017

2018-01-26 Thread Marc Gravell
Protoc is available for multiple OSes here: https://github.com/google/protobuf/releases/tag/v3.5.1 Note sure about pre-compiled libs; for Java, they're on mvnrepository; for C# they're on NuGet, etc. On 26 January 2018 at 15:22, 'Frank Willen' via Protocol Buffers < protobuf@googlegroups.com>

Re: [protobuf] what is TypeModel.cs and why is it missing ?

2018-01-30 Thread Marc Gravell
This is protobuf-net, so I suppose I should chime in :) Can you please give a precise copy of the error message? And how did you reference the library? Did you just add the NuGet package as normal? Or did you do something more exotic? .NET libraries are almost usually distributed as compiled

Re: [protobuf] Migrating legacy code to use Protobuff

2018-02-13 Thread Marc Gravell
Protobuf doesn't touch security, so we can ignore that one. Modelling datasets/DataTable is awkward. It isn't really a natural fit, but it can be manually forced. However, the first thing I'd say is: have you set the "RemotingFormat" on the dataset to **binary** before using your existing

Re: [protobuf] Migrating legacy code to use Protobuff

2018-02-14 Thread Marc Gravell
:07 am, "Som Shankar Bhattacharyya" < bhattacharyya...@gmail.com> wrote: > I see no remting format set. Looks like it used the default xml format. > > On Wed, Feb 14, 2018 at 12:11 AM, Marc Gravell <marc.grav...@gmail.com> > wrote: > >> Protobuf doesn'

Re: [protobuf] Re: How to speedup serialization and deserialization process?

2017-12-22 Thread Marc Gravell
I did a test locally using protobuf-net (since that is what I'm most familiar with); to get an output of about 3,784,000 I used a count of 172000 items in the inner array - does that sound about right? Then I tested it in a loop as per this gist: https://gist.github.com/mgravell/

Re: [protobuf] Is protobuffers right for me?

2018-07-29 Thread Marc Gravell
> I didn't see anything about lists though See: "repeated"; this is pretty much a synonym for "list". > Some items may reference other incoming packets. No, there is no concept of an object id, whether for in-message or out-of-message referencing. On Sun, 29 Jul 2018 at 22:38, M P wrote: >

Re: [protobuf] Change Timestamp Format

2018-08-19 Thread Marc Gravell
It is a little unclear what you mean, since the javascript Date constructor itself takes the year first, but that is nothing to do with protobuf or JSON, and nothing to do with the format. If you mean the JSON, then: In the JSON format, timestamp is always RFC 3339. In the binary format,

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread Marc Gravell
You should be able to encode ipv4 in 4 bytes, making fixed32 ideal, since you can avoid the length prefix. For ipv6, you're going to need 16 bytes, so "bytes" is probably your best bet, since it will only require a single header. You can then create a union of those: oneof ip_addr {

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread Marc Gravell
t; -> OR 1 ipv4 + 1 ipv6 addresses > in the field "localEndpoint". > > So in that case, is "oneof" usage correct? I think that a "oneof" cannot > be repeated. Please correct me if I am wrong. > > On Wednesday, July 18, 2018 at 12:54:39 PM UTC+5:30, Mar

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread Marc Gravell
size of (encoded message > using "int" type) > > Is my understanding correct? Thanks! > > > On Wednesday, July 18, 2018 at 2:40:01 PM UTC+5:30, Marc Gravell wrote: >> >> At that point I'd probably use "repeated bytes", then. It'll cost you an >

Re: [protobuf] Decoding message protobuff

2018-07-17 Thread Marc Gravell
Btw you might find https://protogen.marcgravell.com/decode useful - it explains how each byte is interpreted. It doesn't give the details (so: it doesn't explain how varint works), but it at least makes it explicit which bytes have contributed to which outcomes. On Tue, 17 Jul 2018, 08:22 Marc

Re: [protobuf] Decoding message protobuff

2018-07-17 Thread Marc Gravell
AA 06 is indeed 101, that's "varint" encoding. The MSB of each byte is continuation, 7 bits payload, and adjust for endianness. The idea of decode-raw is that it is enough to start guessing at how to reverse engineer a message, for example you can see values that are clearly string IP-addresses.

Re: [protobuf] What is the most efficient protobuf type (in C++) for storing ipv4 or ipv6 address? My address is a boost::asio::ip::address_v4 (or v6)

2018-07-18 Thread Marc Gravell
; If the conversion to string is done, isn't the size of protobuf message > going to be more compared to the case of using > repeated uint32 localEndpoint = 1; > ? > > Please let me know if I have confused you :) Thanks again! > > On Wednesday, July 18, 2018 at 3:08:52 PM UTC+5:30, M

Re: [protobuf] protobuf version 3.6 a compile libprotobuf?

2018-09-06 Thread Marc Gravell
You mention both 3.5 and 3.6 - which did you mean? As for both compiling and links: it kinda depends what platform and/or language you are targeting. So: what are you targeting? You'll usually have to run the protoc output through your own build tools. On Thu, 6 Sep 2018, 07:47 Natalia Duality,

Re: [protobuf] What is wrong with my proto file here? Is it not possible to have 2 repeated fields of different types?

2018-07-12 Thread Marc Gravell
datavalues_srarray and datavalues_prarray need to have different field numbers On Thu, 12 Jul 2018 at 22:50, Himabindu Dittakavi wrote: > Hi All, > > New to protobuf. > Here is my proto file. If i use the code highlighted in yellow it works > but when I add the one in yellow - there is

Re: [protobuf] What is wrong with my proto file here? Is it not possible to have 2 repeated fields of different types?

2018-07-12 Thread Marc Gravell
also, field zero (type) is invalid; you are welcome to use this as an online check tool - but protoc also outputs similar messages: https://protogen.marcgravell.com#gc4759103e204eec4ae1a11ce6089a4bf On Thu, 12 Jul 2018 at 23:01, Marc Gravell wrote: > datavalues_srarray and datavalues_prar

Re: [protobuf] Tags and values

2018-01-22 Thread Marc Gravell
Yes, tags (field numbers) can be non-contiguous. Yes, hex is accepted by protoc No, repeated fields cannot be required On 22 January 2018 at 23:08, Ashwin Kini wrote: > Hi all, > > While defining messages can the *tags *be non continous? The > documentation never

Re: [protobuf] Defining wrapper types in proto file

2018-09-12 Thread Marc Gravell
That's pretty vague. Could you clarify what you're trying to do? On Wed, 12 Sep 2018, 09:00 qplc, wrote: > Hi, > > How do I define wrapper Long value in .proto file. Can anyone help in this? > > > Thanks, > qplc > > -- > You received this message because you are subscribed to the Google Groups

Re: [protobuf] Protobuf 2.6 serialization weird behavior

2018-04-10 Thread Marc Gravell
t; I'll upgrade protobuf and see if issue goes away. Just wanted to make sure > I'm not missing anything. Is there any additional troubleshooting I can > look into to troubleshoot further if the recent release reproduce the issue? > > On Tuesday, April 10, 2018 at 1:46:50 AM UTC-4, Marc

Re: [protobuf] Protobuf 2.6 serialization weird behavior

2018-04-09 Thread Marc Gravell
First thought: what language / platform is this? the C++ generated code is very different to the Java generated code, for example Second thought: 2.6 is pretty old; it is very possible that a bug existed and has been fixed since then (Aug 2014) - does it still happen with more recent releases?

Re: [protobuf] Protobuf 2.6 serialization weird behavior

2018-04-10 Thread Marc Gravell
;> >>> Marc >>> >>> On 10 April 2018 at 14:20, Tony Tony <xxtekn...@gmail.com> wrote: >>> >>>> c++/windows >>>> >>>> I'll upgrade protobuf and see if issue goes away. Just wanted to make >>>> sure I'm not mi

Re: [protobuf] Inheriting protobuf messages

2018-09-03 Thread Marc Gravell
I'm going to share some thoughts here simply for discussion purposes - I don't expect them to be directly applicable. FWIW, protobuf-net has spoofed inheritance for many many years. I'm able to do this because protobuf-net only needs to target .NET, which has good inheritance support. I don't

Re: [protobuf] Decode google-protocol-buffer binary data using hex?

2019-01-05 Thread Marc Gravell
Presumably: convert the hex to bytes, and run it though the normal API for your library/platform? On Fri, 4 Jan 2019, 22:35 I have the java schema and the .proto schema for the data. > > The data is binary represented as hex. Is it possible to decode the data > with the schemas I have? if so

Re: [protobuf] which protobuf type should be used for byte arrays

2019-01-23 Thread Marc Gravell
"bytes" is correct. The problem here is usually "treating binary data as nul-terminated strings", which is almost certainly something *outside* of the protobuf code, but in your code. Basically, you can't ever treat protobuf data as nul-terminated strings. On Wed, 23 Jan 2019, 00:52 What is the

Re: [protobuf] Regarding serializing multiple .proto files

2018-12-18 Thread Marc Gravell
without knowledge of the specific library/framework/language that you're using, I doubt anyone can answer this. On Tue, 18 Dec 2018 at 05:11, Ishaan Aggarwal wrote: > I have multiple .proto files in my project. I came to know that there can > only be a single serializer and de-serializer file

Re: [protobuf] Re: Getting IOException while deserializing a proto which contains a repeated JKL and JKL has a string type set ( works for repeated JKL and JKL has the same with int type set )

2018-12-13 Thread Marc Gravell
there's nothing wrong with those message definitions; you haven't told us which platform and/or library you're using, but: my hunch would be that you're transporting the data incorrectly in some way, meaning: corrupting it in *your* code - or the code you're using to compress/decompress is

Re: [protobuf] define Set> message ,what should I do?

2018-11-23 Thread Marc Gravell
"set" isn't a protobuf concept - the closest that exists is "repeated"; likewise "object" - ideally using some defined message type. Putting those together, that gives you: syntax = "proto3"; message SomeRoot { repeated SomeLeaf items = 1; } message SomeLeaf { map values = 1; } message

Re: [protobuf] Re: Defining wrapper types in proto file

2018-09-12 Thread Marc Gravell
Are you talking about Java's Long here? If so, frankly I'd say: in your DTO layer, use whatever type protoc wants to use for your data, and just use: syntax = "proto3"; message TestMessage{ string attribute1 = 1; map attribute2 = 2; int64 attribute3 = 3; int32 attribute4 = 4;

Re: [protobuf] protobuf-net desrialization taking too long

2019-03-27 Thread Marc Gravell
Hi; I'd love to help you on this - I'm the protobuf-net author, and I also know more than a little about redis; it *might* be a little off-piste for this group though. Running some tests locally with 5000 instances, I get times like 1ms, but it might be that I'm misunderstanding your object model.

Re: [protobuf] protobuf-net desrialization taking too long

2019-03-27 Thread Marc Gravell
MemoryStream(serializedObject)) > { > return (T)Serializer.Deserialize(ms, null, typeof(T)); > } > } > > Thanks much! > Shweta > > On Wednesday, March 27, 2019 at 7:34:58 AM UTC-7, Marc Gravell wrote: >> >> >

Re: [protobuf] protobuf-net desrialization taking too long

2019-03-27 Thread Marc Gravell
> using StackExchange.Redis MGET Yeah, there's really no way for me to dodge this, is there? ;p Minor note: your parallel code currently doesn't actually allow any meaningful parallelism - you *might* want to move the "lock" so that you only "lock" around the "Add". You're also currently doing a

Re: [protobuf] windows cmb protoc error

2019-04-04 Thread Marc Gravell
that just looks like `protoc` isn't in your path, and to be honest I wouldn't really expect it to be; you'll need to either add it to your system path list, or just use it from where-ever it installed On Wed, 3 Apr 2019 at 16:20, abdelrahman hamdy < hamdyabdelrahman...@gmail.com> wrote: > I

Re: [protobuf] Can protocol buffer support partial reading?

2019-05-27 Thread Marc Gravell
What exactly happens? Protocol buffers are designed to be forwards compatible, so adding fields etc is usually fine and expected. Depending on the implementation unexpected fields may be ignored or stored as extension fields. So: is that what you did? And: what happened? Note: changing the data

Re: [protobuf] C# - Can I compile Proto 2 with compiler Proto 3

2019-06-02 Thread Marc Gravell
> On Sun, Jun 2, 2019 at 8:59 AM Marc Gravell > wrote: > >> If it helps, protobuf-net's schema parser can do this. It is a slightly >> different API to the Google implementation, though. >> >> You can test it online at https://protogen.marcgravell.com/ - or the

Re: [protobuf] C# - Can I compile Proto 2 with compiler Proto 3

2019-06-02 Thread Marc Gravell
If it helps, protobuf-net's schema parser can do this. It is a slightly different API to the Google implementation, though. You can test it online at https://protogen.marcgravell.com/ - or the command-line tool is available as a standalone utility via various mechanisms (the standalone

Re: [protobuf] protobuf encoding with FIX prtocol

2019-07-11 Thread Marc Gravell
That definition is simply adding metadata to the field definitions; they won't directly impact protobuf if you're using the default tools, but if you're using custom tools, or a layer on top of protobuf that knows how to inspect metadata, it can do additional things with the information. The

Re: [protobuf] scalar types in service RPCs and partial messages

2019-06-29 Thread Marc Gravell
The "why" is because the marshaller assumes the root is a message; however, you should look at "wrappers.proto" - there are well-known wrappers for single values of most common types, including string. Also, prefer "empty.proto" for empty, not your own. On Sat, 29 Jun 2019 at 13:25, Ananya Bhat

[protobuf] Re: Nested Types in C# generated code causes serilization issue

2019-08-19 Thread Marc Gravell
And can we see some code that actually demonstrates this problem? That would really help here. -- 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

Re: [protobuf] Re: Nested Types in C# generated code causes serilization issue

2019-08-20 Thread Marc Gravell
Aug 2019, 06:32 arun kumar, wrote: > @Marc Gravell, > > I auto-generated ".cs" files from each ".proto" file. . Whereever a > message declared inside another message in proto, auto-generated cs file is > generated as " Nested Types " and Types class

Re: [protobuf] Re: Nested Types in C# generated code causes serilization issue

2019-08-21 Thread Marc Gravell
Aug 2019 at 10:28, Arun wrote: > I did the same but it throwing the error.. I dont know what I am making > mistake here . All my application are 3.5 .net version, > > Please find actual CS file which I am trying to serialize. > > On Wed, 21 Aug 2019 at 14:06, Marc Gravell wrote:

Re: [protobuf] Re: Nested Types in C# generated code causes serilization issue

2019-08-21 Thread Marc Gravell
that it should work with the corresponding protobuf library. >> >> On Tue, 20 Aug 2019, 06:32 arun kumar, wrote: >> >>> @Marc Gravell, >>> >>> I auto-generated ".cs" files from each ".proto" file. . Whereever a >>>

Re: [protobuf] What are the encoding formats supported by protobuf?

2019-07-18 Thread Marc Gravell
Protobuf binary or protobuf-flavored JSON. On Thu, 18 Jul 2019, 08:35 Pratibha Pruno Xavier, wrote: > Hi all, > > What are the encoding formats supported by protobuf 3? > > THanks, > Pratibha > > -- > You received this message because you are subscribed to the Google Groups > "Protocol

Re: [protobuf] Protocol Buffer Wrappers returning single character

2019-11-05 Thread Marc Gravell
Can you show what you mean by wrappers here? If you dump the payload and inspect it (protoc, or there's a tool at https://protogen.marcgravell.com/decode), is the data in the payload? A minimal example, in some way, would really help On Tue, 5 Nov 2019, 20:55 SW89, wrote: > Good Afternoon, > >

Re: [protobuf] How to correctly understand the term "wire format ordering" and "on the wire" in document "Language Guide (proto3)"?

2019-11-05 Thread Marc Gravell
It just means "when serialized" i.e. when written into binary or JSON for storage / transmission; the "wire format ordering" one is emphasizing that maps have no defined order whether in-memory or serialized, and you should not rely on the order in which elements appear when serialized - on disk /

Re: [protobuf] Can the client parse the interface and message structures of the server?

2019-12-14 Thread Marc Gravell
That would prpbably be a great question for James NK over on the relevant GitHub repo. IIRC the sample server includes reflection, though: https://github.com/grpc/grpc-dotnet/ On Sat, 14 Dec 2019, 12:22 erik stroeken, wrote: > Thanks Nadav Samet > I've been trying to implement the concepts

<    1   2   3   4   >