TCP_NODELAY
TCP_NODELAY is option given to setsockopt system call:
#include <netinet/tcp.h>
int yes = 1;
int result = setsockopt(sock,
IPPROTO_TCP,
TCP_NODELAY,
(char *) &yes,
sizeof(int)); // 1 - on, 0 - off
if (result < 0)
// handle the error
This is to set Nagle buffering off. You should turn this option on only if you really know what you are doing.
本文链接地址:https://const.net.cn/725.html