Prev: Compiling 64-bit Tcl/Tk8.4.19 with Sun Studio 12.1 Failed due to syntax error!!
Next: tclkit string size limit?
From: Alexandre Ferrieux on 24 Jul 2010 07:18 On Jul 22, 7:57 pm, Jan Kandziora <j...(a)gmx.de> wrote: > > for passing arbitrary structured data through a network protocol, I'd like > to use binary format/binary scan. My idea is to pass the format, then the > binary blob through the channel, e.g. "c3Ic10I4\0<binary string>". No > problem in generating this. Side question: how useful is it for the receiver to know the exact layout of the packet (here in four fields) and parse the fields into separate variables if it doesn't know how to use them ? A global length, and possibly a version identifier, should be sufficient... Am I missing something ? -Alex
From: Joe English on 25 Jul 2010 13:49
Jan Kandziora asked: > > for passing arbitrary structured data through a network protocol, I'd like > to use binary format/binary scan. My idea is to pass the format, then the > binary blob through the channel, e.g. "c3Ic10I4\0<binary string>". > No problem in generating this. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What are you generating this from? Do you have some other, higher-level description of the data format from which you're generating the format string? > The problem is when the other side parses the format "c3Ic10I4". How to know > in advance how many variables are needed? Is there some code snippet out > there which does the trick? If so, you can use the same upstream source to generate the list of variables to assign to. --Joe English |