Skip to content

Commit 87421bf

Browse files
committed
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
1 parent 20cf435 commit 87421bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/mqtt/paho/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static int esp_write(Network *n, unsigned char *buffer, unsigned int len, unsign
155155

156156
if (FD_ISSET(n->my_socket, &fdset)) {
157157
do {
158-
rc = send(n->my_socket, buffer + sentLen, len - sentLen, MSG_DONTWAIT);
158+
rc = send(n->my_socket, buffer + sentLen, len - sentLen, 0);
159159

160160
if (rc > 0) {
161161
sentLen += rc;

0 commit comments

Comments
 (0)