Re: Transmitting strings via tcp from a windows c++ client to a Java server



Hi,

Chris Uppal wrote:
Normally I just ignore people who don't follow "The Rules"

Thanks for not ignoring me ;-)


That algorithm will not give you the size in bytes of a UTF-8 encoded string

You're right, of course.

[easiest way to calc utf-8 buffer len ] is just to let the platform
do the encoding and then transmit the length of the resulting byte array

That is what we'll probably do, in the end.

make very sure [doc] is /very/ clear about the meaning of the size field

Agree - very important to clearly state 'type of length' .


As a side note: you've mentioned zlib in a prior post. We do plan to
compress parts to the network-transferred data. We plan, however on
using
an open source lib called LZMA ( http://www.7-zip.org),
which achieves impressive compression ratios at a reasonable CPU cost
(see: http://tukaani.org/lzma/ ).
Do you feel we've missed any important considerations here?


Thanks again,

Gilad

.



Relevant Pages

  • Re: Aaahhrg! Trouble passing an array of structs to a function!
    ... Yeah right! ... return the address of a specific element from an array of my choice ... int x = 0; ... It would be interesting to see how you plan to actually implement this ...
    (microsoft.public.vc.language)
  • Re: Extracting information from cells
    ... that would return a cell containing that string. ... I need it to return the actual [21x21x3 uint8] ... not return the 1x1 array. ... "Tired minds don't plan well. ...
    (comp.soft-sys.matlab)
  • Re: construct AoA with REXML XPath?
    ... but I wonder if there is a rock-solid guarantee that each array ... that is an element of idsAndJellyBeans is in fact from the same "plan" ... be sure that the id and the jellyBean in each individual array had FER ... SHURE come from the same "plan" record. ...
    (comp.lang.ruby)
  • Re: strange conditional format behavior
    ... Even though the array is a 1 element array, ... the samplecode is blank or A,B,C,D,E,F,G. ... witch indicates if te results meet the plan. ... Now I want for each labcode in a row to do the same, ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Problem creating working array value pair
    ... 'spiritgifts' => 'Spiritual Gifts', ... 'weightloss' => 'Weight Loss', ... 'plan2' => 'The Plan', ... // Make an associative array by use its key as page name. ...
    (comp.lang.php)