diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2018-10-07 20:58:42 +0300 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-10-17 14:19:06 +1100 |
commit | 0c18633ea9bed6a0c1031357c4eacbb016deb41a (patch) | |
tree | 83a28c7206034e4b8caa920c4f4d4343284a416f /tests/micropython/heapalloc_bytesio.py | |
parent | 80a25810f9b246094b31ce7d465a0f25842c9be6 (diff) |
unix/modusocket: Finish socket.settimeout() implementation.
1. Return correct error code for non-blocking vs timed out socket
(POSIX returns EAGAIN for both, we want ETIMEDOUT in case of timed
out socket). To achieve this, blocking/non-blocking flag is added
to the mp_obj_socket_t, to avoid issuing fcntl() syscall each time
EAGAIN occurs. (mp_obj_socket_t used to be 8 bytes, having some room
in a standard 16-byte alloc block.)
2. Handle socket.settimeout(0) properly - in Python, that means
non-blocking mode, but SO_RCVTIMEO/SO_SNDTIMEO of 0 is infinite
timeout.
3. Overall, make sure that socket.settimeout() call switches blocking
state as expected.
Diffstat (limited to 'tests/micropython/heapalloc_bytesio.py')
0 files changed, 0 insertions, 0 deletions