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.

tcp_nodelay

本文链接地址:https://const.net.cn/725.html

标签: none

添加新评论