Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 524be388bbc07ddde6144dd2038f037fee87d7c1
Ticket: 1329568fffffffffffffffffffffffffffffffff
[socket -async] and [puts]: Inadequate documentation?
User & Date: oehhar on 2014-03-11 07:42:58
Changes

  1. assignee changed to: "max"
  2. closer changed to: "nobody"
  3. comment changed to:
    What happens if I open a socket with the -async option and then 
    immediately start writing to the channel? The documentation 
    mentions what happens when reading (although only in terms of 
    [gets]). It does have information on how [flush] works, but if I write 
    a large amount of information, is it possible I might fill up some 
    buffer? What happens then?
    
  4. icomment:
    In the current branch [bug-13d3af3ad5] this is addressed and works as follows:
    
    a) blocking socket
    
    set h [socket -async $host $port]
    ...
    puts $h $data
    
    With the puts, the socket is switched to syncroneous mode. If this succeeds, the puts succeeds, otherwise, the puts fails.
    
    b) non blocking but without event queue:
    set h [socket -async $host $port]
    fconfigure $h -blocking 0
    gets $h $data
    
    I don't know what happens with a puts, but with gets, each time the async connect is proceeded until connected and then it returns any received data.
    
    There are now tests for that...
    
  5. login: "oehhar"
  6. mimetype: "text/plain"
  7. severity changed to: "Minor"
  8. username: "oehhar"