[Python-Dev] ssl module integration with asyncore

Giampaolo Rodola' gnewsg at gmail.com
Thu Nov 29 15:10:57 CET 2007


On 29 Nov, 06:00, Bill Janssen <jans... at parc.com> wrote:

> I think it's simpler to let the SSL module do it, even though it comes
> at the expense of blocking the thread till the handshake is complete.

> That's essentially what happens already.  The question is whether the
> SSL setup code is allowed to block the non-blocking socket till the
> SSL handshake is complete.


No, the SSL code should NOT be allowed to block anything in any case,
even though the handshake is still not completed, in which case just
retry it at a later time.
Meanwhile the application must be able to do other things, like read
or write from other sockets.
If the handshake would complete in 1 second that would mean that the
application won't do anything else until that operation is finished,
holding up the entire loop.
That means you would block other clients connected at that time (e.g.
applications serving more than 1 client at time), transfers in
progress and so on...
That would be only reasonable when using threads or multiple processes
but not in an asynchronous environment.


More information about the Python-Dev mailing list