Skip to content

Commit

Permalink
disable nagle for UART TCP (#9079)
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag authored May 28, 2023
1 parent 26145ec commit 8cd3383
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/drivers/serial_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>
#include <netinet/tcp.h>

#include "common/utils.h"

Expand Down Expand Up @@ -147,6 +148,7 @@ static tcpPort_t *tcpReConfigure(tcpPort_t *port, uint32_t id)
#endif

int one = 1;
err = setsockopt(port->socketFd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
err = setsockopt(port->socketFd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
err = fcntl(port->socketFd, F_SETFL, fcntl(port->socketFd, F_GETFL, 0) | O_NONBLOCK);

Expand Down

0 comments on commit 8cd3383

Please sign in to comment.