Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 78064f32a70ea748b6ce61099be4652f97e5a7d3
Ticket: 3325339fffffffffffffffffffffffffffffffff
socket-14.2 fails
User & Date: rmax on 2011-06-28 14:44:07
Changes

  1. icomment:
    Ah - I think I got it. My code was already reposting the event, because OpenBSD also removes the writable state from the socket when reading and clearing the error, but the check for whether this reposting is needed at the bottom of CreateClientSocket() was flawed. It only checked for status being smaller than zero, but getsockopt returns the error value as a positive integer.
    So, changing the "if (status < 0) {" to "if (status != 0) {" in the last block of CreateClientSocket() should do the trick.
    After that change, strace shows that no second select is happening anymore.
    
    BTW, is it really needed to watch the socket for exceptions here? I did it, because the internal event handler for server socket callbacks do so, but in my tests I've never seen a socket to fire an exception. Given that it is not even possible to set up an exception handler from script level, my guess would be that it is not needed.
    
    
  2. login: "rmax"
  3. mimetype: "text/plain"
  4. username: "rmax"