     sock = SSL_get_fd(ssl);

        FD_ZERO(&amp;wfds);
        FD_ZERO(&amp;rfds);

        /*
         * Find out if we would like to write to the socket, or read from it (or
         * both)
         */
        if (SSL_net_write_desired(ssl))
            FD_SET(sock, &amp;wfds);
        if (SSL_net_read_desired(ssl))
            FD_SET(sock, &amp;rfds);
        width = sock + 1;

        /*
         * Find out when OpenSSL would next like to be called, regardless of
         * whether the state of the 