Thanks again for thinking about it at all, out loud or otherwise. :P
The 32kB is just something I saw somewhere about gzip streams. I don't remember where, I probably shouldn't have mentioned it.
If I do this (assume proper var scoping)–
gunzip \$data => \$out;
print $out, $/;
–it will display something like–
<status>connected</status>
?R??0 ????l??????@?
+U?ެ??/?%y???p???v?Po#[???-???x?
>\'Ϩ??4'?V.6?6?֤~5Y???0???C]?$?@m~OgQ?uǃ8?Y?E?8<?Le?4
+?6??٬&qd?x#1
Amended to–
$collected .= $data;
gunzip \$collected, \$out;
print $out, $/;
We get (it's ignoring the Accept and returning XML)–
<status>connected</status>
<quote>
<ask>166.29</ask>
<asksz>500</asksz>
<bid>166.26</bid>
…
</quote>
...
And then dies after awhile, it's inconsistent where but never sooner than 5kB in, with an "unexpected end" style message.
Adding this lets it run for—maybe, I didn't let it run that long—forever, but it's still stacking up an ever growing scalar and gunzipping the same data over and over–
$collected .= $data;
gunzip \$collected, \$out, MultiStream => 1;
print $out, $/;
I expect I will have to come up with seek/tell/truncate kind of solution to keep the data from growing forever that uses the MultiStream to reset itself automatically. Haven't had time to go back to it. I feel like this must be a solved problem and I'm just looking in the wrong place. :| |