On Tue, Nov 08, 2005, Chong Peng wrote: > thanks, dr. henson, maybe what i should ask is that if there is a way, in > open ssl, > to accomplish what "select" acomplishes in the regular socket api? by reading > your answer to my question, i guess there are ways to do this. can you be a > little bit more specific? what exactly is "OSes equivalent of select"? and > what are "several variations"? if it will take too long for you to answer > in an email, could you please give me a place to find relative information? >
In general the OpenSSL BIO APIs (and SSL_read/SSL_write) will either read/write data or indicate that the underlying transport cannot do so. The way this is indicated is mentioned in the relevant manual pages. When the APIs signal that data cannot be read or written it is then the applications reponsibility to wait until this condition is cleared and retry. For example by calling select() on the underlying file descriptor. The "several variations" depends on the actual events you want to process. If for example you want to process terminal I/O and socket data then select() may be OK for Unix but you'd have to do something else under Windows. Similarly if you want to process socket I/O and some GUI event (for example a mouse click on a "cancel" button) you'd use an alternative call or possibly restructure the way the application is written. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Funding needed! Details on homepage. Homepage: http://www.drh-consultancy.demon.co.uk ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]