我正在尝试将Delayed_ack 值从OS X 中的3(默认)更改为0。我可以以编程方式更改发送空间,但不能更改delayed_ack。想法?谢谢。
int sendspace,retval,new_sendspace,len;
len = sizeof(sendspace);
new_sendspace = 131072;
retval = sysctlbyname("net.inet.tcp.sendspace", &sendspace, &len,&new_sendspace, &len);
以上工作。
// Turn off delayed Ack
int delayed_ack = 0;
len = sizeof(delayed_ack);
retval = sysctlbyname("net.inet.tcp.delayed_ack", &delayed_ack, &len, &delayed_ack,
&len);
printf("retval for delayed ack is %d\n",retval);
delay_ack 永远不会被设置为 0。