Commit 328ae63
committed
unix-ffi/socket: Use C socket type directly instead of Python subclass.
MicroPython's stream protocol inheritance is broken for Python
subclasses of C types: the C-level MP_STREAM_GET_FILENO ioctl reads
from the wrong object layout, returning a garbage fd. This causes
select.poll / asyncio to poll the wrong descriptor. Remove the
socket subclass and use _socket.socket directly, moving accept's
address translation to a standalone helper.
Made-with: Cursor1 parent f794795 commit 328ae63
1 file changed
Lines changed: 16 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
30 | 46 | | |
31 | 47 | | |
32 | | - | |
33 | 48 | | |
34 | | - | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
0 commit comments