Open dmartauz opened 6 years ago
Anyway is there any way how to modify timeout of this method?
It seems to be a limitation of the CC3100 that getaddrinfo() is blocking and doesn't have a way to configure the timeout. See eg here: https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/532971/1945259
From that link there is a suggestion to reduce the number of retries, which defaults to the maximum of 32, to shorten the time that getaddrinfo() will spend waiting.
For now my solution is to perform DNS lookup only once after boot and not with every socket.connect().
Anyway it might make sense to reduce number of retries (e.g. to 8). What is your opinion?
In issue https://github.com/micropython/micropython/issues/2402 a solution was proposed to make socket.settimeout() working for socket.connect(). It seems to work well.
However it does not work for socket.getaddrinfo() as there seems to be fixed timeout of 19s.
EDIT: Looking at the code once again it is obvious that calling settimeout() method of socket instance cannot affect timeout of socket.getaddrinfo(). Anyway is there any way how to modify timeout of this method?