[Python-Dev] Synchronous and Asynchronous servers in the standard library

"Martin v. Löwis" martin at v.loewis.de
Tue Nov 9 07:07:56 CET 2004


exarkun at divmod.com wrote:
> KQueue's performance benefits over select() are absolutely noticable
> from Python. We're talking orders of magnitude stuff here.  select()
> is fine for small servers

Can you quantify this a bit? How can I tell whether my server is small,
and how do I notice a the difference?

> Keep in mind there is no support for SSL servers in the standard
> library (this is still true, right?

True.

> If it can be avoided, I don't see any reason to require a separate
> class for each of them for each protocol.

I'm not sure it can be avoided. But then, I have not implemented any SSL
server in Python. I would think that
- in SMTP, you *must* reuse the socket, since the SSL modes starts
   only after the STARTTLS command
- in HTTP, you need to be SSL-aware, in order to pass the server
   key to the SSL library, and in order to validate the client
   certificate (if the client choses to send one)
IOW, whether or not SSL is used causes changes beyond the transport,
and specific to the protocol and application logic.

> asyncore will interpret this to mean
> the socket has been closed by the peer and call handle_close()! 

I see.

Regards,
Martin


More information about the Python-Dev mailing list