From 87421bfe92c0fc369a13fd8f16f6bb1458ec4753 Mon Sep 17 00:00:00 2001 From: Chen Wu Date: Thu, 3 Jan 2019 10:39:05 +0800 Subject: [PATCH] fix: high thoughput(payload>10KB) cause send failed 1. socket would block at send(), return -1 when set MSG_DONTWAIT 2. changed to ~MSG_DONTWAIT, send() will block until all payload send over 3. recv() should keep MSG_DONTWAIT attribute, otherwise will lead to low thoughtput --- components/mqtt/paho/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mqtt/paho/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c b/components/mqtt/paho/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c index 408dd636..30edd274 100644 --- a/components/mqtt/paho/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c +++ b/components/mqtt/paho/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c @@ -155,7 +155,7 @@ static int esp_write(Network *n, unsigned char *buffer, unsigned int len, unsign if (FD_ISSET(n->my_socket, &fdset)) { do { - rc = send(n->my_socket, buffer + sentLen, len - sentLen, MSG_DONTWAIT); + rc = send(n->my_socket, buffer + sentLen, len - sentLen, 0); if (rc > 0) { sentLen += rc;