bart van deenen
unread,Jul 17, 2012, 7:59:04 AM7/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pi...@googlegroups.com
Hi Anton, all
I'm using the generated piqi code with the integer Code field to identify my records in a tcp stream:
Id = #wantransport_msg_id{cmd_nr = 123,reply_cmd_nr = 321, origin = 1,destination = 2}
erlang:list_to_binary(wantransport_piqi:gen_msg_id(99, Id)).
<<154,6,10,8,246,1,16,130,5,24,2,32,4>>
And decoding:
piqirun:parse_record( <<154,6,10,8,246,1,16,130,5,24,2,32,4>> ).
[{99,{block,<<8,246,1,16,130,5,24,2,32,4>>}}]
Id = wantransport_piqi:parse_msg_id( <<8,246,1,16,130,5,24,2,32,4>> ).
The problem I have is with the order of items in the list returned by piqirun:parse_record( Binary). Looking in the code I see that you order the list by ascending Code. Why? Am I abusing the integer Code?
In my case, when I concatenate some binaries from multiple piqi calls and send them over tcp, they come in in an order that I don't want.
Should I modify piqirun, or is there something I'm missing?
I really like the idea of the integer prefix, that way I can abstract my transport information from the payload, and don't have to hard code recordtypes in the protocol.
Thanks
Bart