Enable SO_REUSEADDR in LWIP

This commit is contained in:
Jeroen Domburg
2016-09-18 16:43:48 +08:00
parent 7fade89fb6
commit 4d4c6a3694
2 changed files with 2 additions and 2 deletions

View File

@@ -405,7 +405,7 @@ extern unsigned char misc_prof_get_tcp_snd_buf(void);
/** /**
* SO_REUSE==1: Enable SO_REUSEADDR option. * SO_REUSE==1: Enable SO_REUSEADDR option.
*/ */
#define SO_REUSE 0 #define SO_REUSE 1
/* /*
---------------------------------------- ----------------------------------------

View File

@@ -147,7 +147,7 @@ int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char
/*SO_REUSEADDR option dafault is disable in source code(lwip)*/ /*SO_REUSEADDR option dafault is disable in source code(lwip)*/
#if SO_REUSE #if SO_REUSE
n = 1; int n = 1;
if ( setsockopt( ctx->fd, SOL_SOCKET, SO_REUSEADDR, if ( setsockopt( ctx->fd, SOL_SOCKET, SO_REUSEADDR,
(const char *) &n, sizeof( n ) ) != 0 ) { (const char *) &n, sizeof( n ) ) != 0 ) {
close( ctx->fd ); close( ctx->fd );