Overview
| Artifact ID: | a99df884c672f8924b9e4af2cbffa5b2980d8190 |
|---|---|
| Ticket: | 1665628fffffffffffffffffffffffffffffffff
destructive scan of a ByteArray |
| User & Date: | dgp on 2007-02-22 22:07:12 |
Changes
- icomment:
Logged In: YES user_id=80530 Originator: NO While the observations appear to be correct, and we should consider addressing what we can... ...the way to avoid these problems is to not use a "buffer" in the first place, I think. Tcl is not C and C coding patterns often don't map well onto it. Instead of one huge [read] into a "buffer" from which you struggle to process things due to some limitations and inefficiencies of the base commands, why not only [read] as many bytes as you need at a time to do what you need to do? binary scan [read $sock 4] I dlen binary scan [read $sock $dlen] a* data I think the availability of this simple workaround is why we haven't noticed these issues much before.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"