bpo-37027: Return a proxy socket object from transp.get_extra_info('socket') by 1st1 · Pull Request #13530 · python/cpython

@1st1

@1st1 1st1 changed the title bpo-37027: Return a proxy socket object from transp.get_extra_info('s… bpo-37027: Return a proxy socket object from transp.get_extra_info('socket')

May 23, 2019

asvetlov

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asyncio saves at least "process" and "pipe" in extra info.
Should we wrap these things too?
Should we wrap sockets from asyncio.Server()?

@1st1

@1st1

@1st1

Andrew, please re-review this PR (and please hit the merge button if it's ready). I've relaxed this PR - now all socket methods can be called as they are in 3.7, but we issue a warning that we won't support that in 3.9.

@1st1 1st1 mentioned this pull request

May 27, 2019

asvetlov


def shutdown(self, how):
# asyncio doesn't currently provide a high-level transport API
# to shutdown the connection.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically there is transport.write_eof() for closing writing.
There is no API for closing reading though.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and I know some people use sock.shutdown for that. Should we add an API to transports?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, to make the transition to new Python smoother.
Not urgent, though. Minor thing.

asvetlov

@miss-islington

@1st1: Status check is done, and it's a success ✅ .

DinoV pushed a commit to DinoV/cpython that referenced this pull request

Jan 14, 2020

@1st1 @DinoV