MATLAB Answers

Disable Nagle Algorithm on tcpclient

7 views (last 30 days)
Levi Devries
Levi Devries on 4 Nov 2020
Answered: Manas Meena on 2 Dec 2020
The tcpip function allowed a user to disable the Nagle algorithm. tcpip is being replaced by tcpclient, but I don't see the ability to disable Nagle's algorithm for tcpclient. Is it possible to disable it in MATLAB?


Sign in to comment.

Answers (1)

Manas Meena
Manas Meena on 2 Dec 2020
The matlabroot/toolbox/coder/rtiostream/src/rtiostreamtcpip/rtiostream_tcpip.c file shows how you can turn off Nagle's algorithm:
/* Disable Nagle's Algorithm*/
option = 1;
sockStatus = setsockopt(lFd,IPPROTO_TCP,TCP_NODELAY,(char*)&option,sizeof(option));
The code for your custom TCP/IP implementation can require modification.


Sign in to comment.





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!