Hi there,
On Wed, 24 Nov 1999, Dan Kegel wrote:
> Hi,
> I see on the mailing list that OpenSSL does support
> nonblocking I/O, and various people mention using it with
> poll(), but I have yet to find a nice example program
> that uses poll() to both wait for new connections and
> decide when it's time to service existing ones.
> (You know, the classical event-based server.)
well s_client and s_server kind of do it. However, they only handle one
connection at a time, eg s_server will not do any read selects on it's
listening socket until after the existing connection is dropped (I think?
perhaps this has changed?). The code is hardly the most beautiful thing
you'll ever gaze upon, and you'd probably want to put a wrapper around the
whole socket/BIO machinery to make it pleasant to use in your own coding
(and especially to manage multiple connections) but it is illustrative if
you stare at it long enough.
I've also found printing it out, dipping it in lemon juice, and holding it
up to ultra-violet light can help.
> I'd like to use OpenSSL with Linux's whacky new
> SIGIO-based event queuing doohicky that supposedly
> gives much better performance than poll(), too, but
> I'll take an old-style poll() or select() example...
> I'm not picky...
s_server and s_client use select() as far as I can recall. I think poll()
is sexier but not many platforms seem to support it, and those that do
have select() implemented as a front-end to poll() so select() seems to be
the cross-platform way to go. bummer.
Cheers,
Geoff
----------------------------------------------------------------------
Geoff Thorpe Email: [EMAIL PROTECTED]
Cryptographic Software Engineer, C2Net Europe http://www.int.c2.net
----------------------------------------------------------------------
May I just take this opportunity to say that of all the people I have
EVER emailed, you are definitely one of them.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]