From a84465ddba5b443ecc0473cc8e9c20d94d4bada1 Mon Sep 17 00:00:00 2001 From: cpq Date: Mon, 10 Oct 2022 13:41:07 +0100 Subject: [PATCH] Use MG_SOCK_LISTEN_BACKLOG_SIZE -> 128 for FreeRTOS-TCP --- mongoose.h | 6 ++++++ src/arch_freertos_tcp.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/mongoose.h b/mongoose.h index 03f916ad..bd4049ba 100644 --- a/mongoose.h +++ b/mongoose.h @@ -293,6 +293,12 @@ struct timeval { #define EINTR pdFREERTOS_ERRNO_EINTR #endif +// FreeRTOS-TCP uses non-standard semantics for listen() backlog size. It is +// not a backlog size for pending SYN connections, but a max socket number +#ifndef MG_SOCK_LISTEN_BACKLOG_SIZE +#define MG_SOCK_LISTEN_BACKLOG_SIZE 128 +#endif + #endif // MG_ARCH == MG_ARCH_FREERTOS_TCP diff --git a/src/arch_freertos_tcp.h b/src/arch_freertos_tcp.h index e8a215cf..c305026a 100644 --- a/src/arch_freertos_tcp.h +++ b/src/arch_freertos_tcp.h @@ -82,4 +82,10 @@ struct timeval { #define EINTR pdFREERTOS_ERRNO_EINTR #endif +// FreeRTOS-TCP uses non-standard semantics for listen() backlog size. It is +// not a backlog size for pending SYN connections, but a max socket number +#ifndef MG_SOCK_LISTEN_BACKLOG_SIZE +#define MG_SOCK_LISTEN_BACKLOG_SIZE 128 +#endif + #endif // MG_ARCH == MG_ARCH_FREERTOS_TCP