On 4/6/14, Guido van Rossum <[email protected]> wrote:
> Hm, I wonder if there isn't an even simpler approach that even works with
> the current asyncio public API. You can pass an already-open socket to
> create_connection() -- maybe you can use this (also passing ssl=<context>)
> and it would just work?

Its possible. But that needs manual manupulation of the socket outside
the asyncio domain. It is ugly. (sync code, selects, timeouts etc..)
This undermines the reason for using asyncio.

I thought about another possibility:

StreamWriter.transport.get_extra_info('socket') gives access to the socket.
That socket may be manually wrapped. Can you confirm if this operation
is safe? But again here we have to handle the Handshake syncronously
which is ugly too.

I think there is no quick solution other than proper handling of the whole
wrapping process in asyncio terms.

Regards,
Imran

Reply via email to