Socket connect timeout - Feature request
My use case is:
MP is connected to a network where can reach the internet (upstream network) and devices in the LAN (downstream network).
Is known that downstream devices are there and sometimes many, I need to reduce the sock.connect(addr) timeout out so this blocking call does not hang the whole system too much.
So an optional timeout parameter (in msec) would be helpful.
Thank you.
extmod/modlwip: Make socket.connect raise ETIMEDOUT on non-zero timeout.
If the socket timeout is 0 then a failed socket.connect() raises EINPROGRESS (which is what the lwIP bindings already did), but if the socket timeout is non-zero then a failed socket.connect() should raise ETIMEDOUT. The latter is fixed in this commit.
A test is added for these timeout cases.
Also, clean up the timeout logic for socket.accept().