您可以使用查看所有系统设置的tcp值
$sysctl net.inet.tcp
从tcp_var.h,tcp_subr.c和tcp_timer.c解释:
> net.inet.tcp.keepidle = keepalive空闲计时器
> net.inet.tcp.keepintvl =发送Keepalive的间隔
> net.inet.tcp.keepinit =建立syn的超时
> net.inet.tcp.mssdflt =默认TCP最大段大小
> net.inet.tcp.v6mssdflt = IPv6的默认TCP最大段大小
> net.inet.tcp.minmss =最小TCP最大段大小
> net.inet.tcp.minmssoverload =允许在MINMSS大小下的每秒TCP段数
> net.inet.tcp.rfc1323 =启用rfc1323(高性能TCP)扩展
> net.inet.tcp.rfc1644 =启用rfc1644(TTCP)扩展
> net.inet.tcp.do_tcpdrain =在mbufs为低时启用tcp_drain例程以获取额外帮助
> net.inet.tcp.pcbcount =活动PCB数量
> net.inet.tcp.icmp_may_rst =某些ICMP不可达消息可能会中止SYN_SENT中的连接
> net.inet.tcp.strict_rfc1948 =确定是否严格遵循RFC1948
> net.inet.tcp.isn_reseed_interval =重新播种ISN秘密之间的秒数
> net.inet.tcp.background_io_enabled =启用后台IO
> net.inet.tcp.rtt_min =允许的最小rtt值
> net.inet.tcp.randomize_ports =随机化TCP端口号
> net.inet.tcp.tcbhashsize = TCP控制块哈希表的大小
> net.inet.tcp.msl =最大段寿命
> net.inet.tcp.always_keepalive =在所有TCP连接上假设SO_KEEPALIVE
> net.inet.tcp.broken_peer_syn_rxmit_thres = TCP在其余尝试期间禁用rfc1323和rfc1644之前重新传输的SYN数
> net.inet.tcp.pmtud_blackhole_detection =路径MTU发现黑洞检测
> net.inet.tcp.pmtud_blackhole_mss =路径MTU发现黑洞检测降低了MSS
我相信默认情况下,如果设置了SO_KEEPALIVE,则会在连接关闭之前发送8个keepalive.时间以毫秒为单位.