Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3625c2f66013e364361122e7e9c2a31e8e06e19c
Ticket: 1665628fffffffffffffffffffffffffffffffff
destructive scan of a ByteArray
User & Date: dvrsn on 2007-02-23 01:45:12
Changes

  1. icomment:
    Logged In: YES 
    user_id=24996
    Originator: YES
    
    I will try the suggestion in my application, but the general problem with 
    
    binary scan [read $sock 4] I dlen
    binary scan [read $sock $dlen] a* data
    
    is that when $sock is non-blocking you are not guaranteed to actually read $dlen bytes; while if it is blocking then it can incur an unacceptably long pause in event handling.  Beyond that, if the "data" itself contains additional counted strings then this technique is of no help since you are no longer reading from a stream.
    
    I wonder if the problem has not been noticed more because it only shows up (as do so many others) with scale -- I did not notice it until my buffer sizes were several megabytes.
    
    
  2. login: "dvrsn"
  3. mimetype: "text/plain"
  4. username: "dvrsn"