Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c5f9217fcdbc92802f0b37482e5a27f4a173b3f6
Ticket: 3325339fffffffffffffffffffffffffffffffff
socket-14.2 fails
User & Date: rmax on 2011-06-28 15:40:06
Changes

  1. icomment:
    Yes, I also figured that more comments are needed and had already written the following two when your post arrived:
    above getsockopt():
                     * Read the error state from the socket to see if the async
                     * connection has succeeded or failed. As this clears the
                     * error condition, we cache the status in the socket state
                     * struct for later retrieval by [fconfigure -error].
    ... and above Tcl_NotifyChannel():
                 * If an asynchronous connection has finally failed, we need to
                 * repost the writable event here, because at least some OSes
                 * clear the writable state from the socket when the error is
                 * read, and so a subsequent select() on behalf of a script level
                 * [fileevent] will not fire.
    I think I'll append the second half of your second comment.
    
    I have no proof that the latest assertion holds, but I am pretty confident it does, as I see no reason why socket should stop being writable after a connection has been established and before any data has been written to it. But of course it shouldn't hurt to call Tcl_NotifyChannel() regardless of the status, as it'll just save the core another round through select() in the successful case.
    
    
  2. login: "rmax"
  3. mimetype: "text/plain"
  4. username: "rmax"