forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esp32/modsocket: Implement socket connect timeout.
LWIP doesn't implement a timeout for blocking connect(), and such a timeout is not required by POSIX. However, CPython will use the socket timeout for blocking connect on most platforms. The "principle of least surprise" suggests we should support it on ESP32 as well (not to mention it's useful!). This provides the additional improvement that external exceptions (like KeyboardInterrupt) are now handled immediately if they happen during connect(). Previously Ctrl-C would not terminate a blocking connect until connect() returned, but now it will. Fixes issue micropython#8326. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
- Loading branch information
1 parent
6117aa6
commit 57cce79
Showing
1 changed file
with
87 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters