[issue26666] File object hook to modify select(ors) event mask

Martin Panter report at bugs.python.org
Tue Mar 29 19:09:23 EDT 2016


Martin Panter added the comment:

Python’s select() call operates at a minimal OS level. I don’t completely understand your __preselect__() etc proposal, but it does sound like you are trying to invent another higher-level “asynchronous” framework like asyncio.

I think you are wrong about the proxy connection being made in the socksocket() constructor. In general, there could be both write and read events depending on the stage of the proxy connection setup. E.g. with a HTTP proxy, there would be write events to establish the underlying TCP connection, and also to send the CONNECT request, and then a read event to receive the proxy’s response.

Perhaps the SSL socket wrapper objects face a similar situation to your problem. In non-blocking mode, SSLWantRead/WriteError exceptions are raised that indicate which select() event is required.

----------
nosy: +martin.panter

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


More information about the Python-bugs-list mailing list