extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking.

Also fix related problems with socket on esp32, improve docs for
wrap_socket, and add more tests.
This commit is contained in:
Thorsten von Eicken
2020-04-02 10:01:16 -07:00
committed by Damien George
parent 2eed9780ba
commit 2c1299b007
10 changed files with 372 additions and 19 deletions

View File

@@ -1,9 +1,9 @@
# test that socket.accept() on a socket with timeout raises ETIMEDOUT
try:
import usocket as socket
import uerrno as errno, usocket as socket
except:
import socket
import errno, socket
try:
socket.socket.settimeout
@@ -18,5 +18,5 @@ s.listen(1)
try:
s.accept()
except OSError as er:
print(er.args[0] in (110, "timed out")) # 110 is ETIMEDOUT; CPython uses a string
print(er.args[0] in (errno.ETIMEDOUT, "timed out")) # CPython uses a string instead of errno
s.close()