I looked at the documentation in MSDN for select(), and it claimed that the
first parameter was unused. I'll try it out.

Thanks.

James.

PS: If you're interested, the doc I read was
http://msdn.microsoft.com/library/psdk/winsock/wsapiref_1ab6.htm


|-----Original Message-----
|From: Pablo J. Royo [mailto:[EMAIL PROTECTED]]
|Sent: 09 October 2000 9:52 AMj
|To: [EMAIL PROTECTED]
|Subject: Re: SSL_read, non-blocking sockets, and Windows.
|
|
|I think you should change the line
|
|    int tNumSocketsReady = select(1, &tSet, NULL, NULL, &tTimeout);
|
| by
|
|    int tNumSocketsReady = select( tSocketFD+1, &tSet, NULL, NULL,
|&tTimeout);
|
|If not, the descriptor you are selecting on may be totally 
|wrong, so your
|select() doesn´t works.
|
|
|-----Original Message-----
|From: James Gaskell <[EMAIL PROTECTED]>
|To: 'SSLU' <[EMAIL PROTECTED]>
|Date: lunes 9 de octubre de 2000 10:33
|Subject: SSL_read, non-blocking sockets, and Windows.
|
|
|>Hi.
|>
|>I'm just starting out with the OpenSSL library, and I've got 
|a problem that
|>I don't know how to fix.
|>
|>I'm trying to read data using SSL_read() from a non-blocking 
|socket on a
|>Windows machine.
|>
|>The problem is that when the SSL_read returns 
|SSL_ERROR_WANT_READ, I don't
|>know how to wait for data to become available.
|>
|>My code is something like:
|>
|>    fd_set tSet;
|>    FD_ZERO(&tSet);
|>
|>    SOCKET tSocketFD = SSL_get_fd(pSSL); // Get the underlying socket.
|>    FD_SET(tSocketFD, &tSet);
|>
|>    int tNumSocketsReady = select(1, &tSet, NULL, NULL, &tTimeout);
|>
|>    if (tNumSocketsReady)
|>    {
|>        tRetVal = SSL_read(pSSL, buf, num);
|>    }
|>    else
|>    {
|>        tRetVal = SOCKET_ERROR;
|>    }
|>
|>However, this doesn't work -- the select() call always 
|returns immediately.
|>
|>I've been banging my head against
|>http://www.openssl.org/docs/ssl/SSL_read.html but it just says:
|>
|>    The calling process then must repeat the call after taking
|>    appropriate action to satisfy the needs of SSL_read().
|>    The action depends on the underlying BIO.
|>
|>What SSL function acts like select() on ordinary sockets? Is 
|there some
|kind
|>of event I can wait on?
|>
|>Thanks for listening!
|>
|>James Gaskell.
|>______________________________________________________________________
|>OpenSSL Project                                 http://www.openssl.org
|>User Support Mailing List                    [EMAIL PROTECTED]
|>Automated List Manager                           [EMAIL PROTECTED]
|>
|
|______________________________________________________________________
|OpenSSL Project                                 http://www.openssl.org
|User Support Mailing List                    [EMAIL PROTECTED]
|Automated List Manager                           [EMAIL PROTECTED]
|
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to