[issue27392] Add a server_side keyword parameter to create_connection

Yury Selivanov report at bugs.python.org
Wed Jun 29 15:14:24 EDT 2016


Yury Selivanov added the comment:

> Rather tham monkey-patching, in general I recommend just copying some
code from the asyncio library and calling that. In this case you'd be
copying a tiny bit of code from create_connection(). You'd still be
calling an internal API, _make_ssl_transport(), but your code would
still be less likely to change when some part of the asyncio library
changes than with monkey-patching. 

But this kind of defeats the purpose of pluggable event loop etc.  I can't implement all asyncio private APIs for uvloop.  Once you start using that, your code can't run on uvloop or any other asyncio implementation.

> Maybe it's just culture shock? Or maybe we just need a public API that roughly represents the pair of calls to _make_ssl_transport() and _make_socket_transport() that are currently appearing both in _create_connection_transport() and in _accept_connection2(), plus some of the code around it that's a little tricky?

That's essentially what I wanted `loop.wrap_socket` to do (see msg269519)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27392>
_______________________________________


More information about the Python-bugs-list mailing list