Skip to content

Commit 741918a

Browse files
committed
esp32/modsocket: Initialise the timeout on an accepted socket.
1 parent bcaef53 commit 741918a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

esp32/modsocket.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ typedef struct _socket_obj_t {
6464
unsigned int retries;
6565
} socket_obj_t;
6666

67+
void _socket_settimeout(socket_obj_t *sock, uint64_t timeout_ms);
68+
6769
NORETURN static void exception_from_errno(int _errno) {
6870
// Here we need to convert from lwip errno values to MicroPython's standard ones
6971
if (_errno == EINPROGRESS) {
@@ -163,6 +165,7 @@ STATIC mp_obj_t socket_accept(const mp_obj_t arg0) {
163165
sock->domain = self->domain;
164166
sock->type = self->type;
165167
sock->proto = self->proto;
168+
_socket_settimeout(sock, UINT64_MAX);
166169

167170
// make the return value
168171
uint8_t *ip = (uint8_t*)&((struct sockaddr_in*)&addr)->sin_addr;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy