← index #18531Issue #2402
Off-topic · high · value 0.127
QUERY · ISSUE

Add function 'settimeout' to class SSLSocket

openby magnus-0opened 2025-12-08updated 2026-03-09
enhancementextmod

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...

CANDIDATE · ISSUE

WiPy/CC3200: usocket.socket.settimeout() not working?

closedby dmartauzopened 2016-09-07updated 2024-08-28
ports

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().

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied