Add function 'settimeout' to class SSLSocket
Description
After wrapping a micropython socket to get a SSLSocket, the function 'settimeout()' fails, reporting that feature doesn't exist (same with 'gettimeout()'). Interestingly though, the 'setblocking()' function does exist and seemingly work.
AttributeError: 'SSLSocket' object has no attribute 'settimeout'
Code Size
Irrelevant (the feature was most likely already supposed to be there but overlooked?)
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
[MODERATOR: This topic may have been better posted under 'micropython-lib' instead of plain micropython...
WiPy/CC3200: usocket.socket.settimeout() not working?
According to the doc:
Set a timeout on blocking socket operations. The value argument can be a nonnegative floating point number expressing seconds, or None. If a non-zero value is given, subsequent socket operations will raise a timeout exception if the timeout period value has elapsed before the operation has completed. If zero is given, the socket is put in non-blocking mode. If None is given, the socket is put in blocking mode.
http://micropython.org/resources/docs/en/latest/wipy/library/usocket.html#usocket.socket.settimeout
It obviously throws an error:
>>> s.settimeout(5.0) Traceback (most recent call last): File "<stdin>", line 1 SyntaxError: decimal numbers not supported
I was not successful with int parameter. Parameter was accepted, but there is no timeout happening for usocket.socket.accept().