On Fri, Feb 07, 2003 at 01:10:30PM +0100, Alexander Biehl wrote: > is there any function "SSL_poll()"? > i would like to see, if there is data I can read.
You can use SSL_pending(ssl) to check if data is available for immediate reading. However, this will just report on data that has already reached the internal buffers and has remained from a previous SSL_read() call; the library is oblivious of any data that has been received from the network and is still waiting in TCP buffers. There's also SSL_peek(), which works similar to SSL_read(), but leaves the data it reads in the internal buffers so that a subsequent call to SSL_read() (or to SSL_peek() again) will still find it. So you could do the following: use non-blocking sockets in you applications; call SSL_peek() with a small length (such as 1) when you want OpenSSL to look for incoming TLS records (see SSL_get_error() manpage) and afterwards, use the SSL_peek() result (or call SSL_pending()) to see if there is data available for you application. -- Bodo M�ller <[EMAIL PROTECTED]> PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html * TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt * Tel. +49-6151-16-6628, Fax +49-6151-16-6036 ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
