I've come up with the following BASIC OpenSSL client from the cli.cpp
example and I am trying to turn it into a multi threaded application with
pthreads.   Each thread will open a brand new connection, it will not read
off of the same connection, so it should not be any different.  I've added
the th-lock.c library into it before the threads are created and after they
are destroyed, from the limited documentation I've found, that should cover
everything.  The only thing I have changed with the basic cli.cpp is that I
am using non-blocking IO through SELECT/FD_ISSET.  By doing this I have also
added support for SSL_ERROR_WANT_READ, so that shouldn't be the issue.  The
problem I am seeing is within the select/FD_ISSET.  My FD_ISSET is failing.
(Enclosed below)


c = select(sockfd+900, &readfds, NULL, NULL, &tv);
if (c < 0) {
        perror("SELECT");
        fprintf(stderr, "Error with the select\n");
        break;
}

if (!FD_ISSET(sockfd, &readfds)) {
        perror("Error");
        fprintf(stderr,"Error with socket\n");
        break;
}

Should I not be using this with OpenSSL and/or pthreads?  Are there any
known issues or can anyone shed some light onto the subject for me?

Thanks in advance,

Nick
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to