From d34fb44df2abe1f48447fb1da0c955cce8bb0cec Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Sun, 31 Dec 2017 05:50:51 +0900 Subject: [PATCH] listen parrameter for Keil tcp net --- wolfssl/test.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index 67855b9df..48ebf1ffd 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -64,7 +64,6 @@ static int wolfssl_tcp_select(int sd, int timeout) { return 0 ; } - #define tcp_select(sd,t) wolfssl_tcp_select(sd, t) /* avoid conflicting Keil TCP tcp_select */ #elif defined(WOLFSSL_TIRTOS) #include #include @@ -853,8 +852,12 @@ static INLINE void tcp_listen(SOCKET_T* sockfd, word16* port, int useAnyAddr, if (bind(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0) err_sys("tcp bind failed"); if (!udp) { - if (listen(*sockfd, 5) != 0) - err_sys("tcp listen failed"); + #ifndef WOLFSSL_KEIL_TCP_NET + if (listen(*sockfd, 5) != 0) + #else + if (listen(*sockfd, 1) != 0) + #endif + err_sys("tcp listen failed"); } #if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_TIRTOS) if (*port == 0) {