On Mon, Jan 12, 2004 at 03:51:46PM +0800, Patrick Coleman wrote: > I'm trying to set up a SSL connection with non blocking sockets. When the > SSL_accept() fails with SSL_ERROR_WANT_READ/WRITE, I go back to my select() > function. However, I'm handling multiple connections at once, so when select() > triggers again, I need to be able to check the state on the SSL to see whether I go > back to SSL_accept, or to a SSL_read or SSL_write on another connection. Other > examples I've read just use a variable like int blocked_on_read, but they only > handle one connection. SSL_state_string seems to do what I want, but I cant find a > list of strings it outputs so I can see what it says when I'm at > SSL_ERROR_WANT_READ/WRITE. I feel that writing a program that gets an SSL into the > SSL_ERROR_WANT_READ state then looking at SSL_state_string > is overkill :-). Is there a list of possible outputs for SSL_state_string anywhere? > Am I going about this the wrong way (should I be using callback functions)?
select() will tell you on which file desciptor action is required. When you have WANT_READ, you set up select() to trigger on incoming data with FD_SET(). Once select() is returning you use FD_ISSET() to find out whether data are available, in which case you continue your operation on this particular file descriptor. Best regards, Lutz -- Lutz Jaenicke [EMAIL PROTECTED] http://www.aet.TU-Cottbus.DE/personen/jaenicke/ BTU Cottbus, Allgemeine Elektrotechnik Universitaetsplatz 3-4, D-03044 Cottbus ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]