summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/asyncio/stream.py
Commit message (Collapse)AuthorAge
* extmod/asyncio: Remove non-working Stream __aenter__/__aexit__ methods.Damien George2023-12-20
| | | | | | | | | It looks like these never worked and there are no tests for this functionality. Furthermore, CPython doesn't support this. Fixes #12995. Signed-off-by: Damien George <damien@micropython.org>
* extmod/asyncio: Add ssl support with SSLContext.Carlosgg2023-12-14
| | | | | | | | | | | | | | This adds asyncio ssl support with SSLContext and the corresponding tests in `tests/net_inet` and `tests/multi_net`. Note that not doing the handshake on connect will delegate the handshake to the following `mbedtls_ssl_read/write` calls. However if the handshake fails when a client certificate is required and not presented by the peer, it needs to be notified of this handshake error (otherwise it will hang until timeout if any). Finally at MicroPython side raise the proper mbedtls error code and message. Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
* extmod/asyncio/stream.py: Fix cancellation handling of start_server.Jim Mussared2023-10-02
| | | | | | | | | | | | | | | | | | | The following code: server = await asyncio.start_server(...) async with server: ... code that raises ... would lose the original exception because the server's task would not have had a chance to be scheduled yet, and so awaiting the task in wait_closed would raise the cancellation instead of the original exception. Additionally, ensures that explicitly cancelling the parent task delivers the cancellation correctly (previously was masked by the server loop), now this only happens if the server was closed, not when the task was cancelled. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* extmod/asyncio: Rename uasyncio to asyncio.Jim Mussared2023-06-19
The asyncio module now has much better CPython compatibility and deserves to be just called "asyncio". This will avoid people having to write `from uasyncio import asyncio`. Renames all files, and updates port manifests to use the new path. Also renames the built-in _uasyncio to _asyncio. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>