V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
zlel
V2EX  ›  问与答

spring boot embeded tomcat 怎么开启 tcp keepalive ?

  •  
  •   zlel · Dec 13, 2019 · 3390 views
    This topic created in 2340 days ago, the information mentioned may be changed or developed.

    写了一个简单的客户端,就是单纯建立 socket 连接,然后调用 setKeepAlive,tcpdump 抓包可以看到按照系统 net.ipv4.tcp_keepalive_time 设定的时间发送空的 ack 包。但是,spring boot 里也按照之前的写法开启 tcp keepalive,好像完全不起作用,spring boot 嵌入了 tomcat,是不是 tomcat 的某些地方需要设置?查询了各种文章,都是设置 tomcat 的 http keep-alive,这个跟我在程序里起的 socket 连接没有关系吧?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6198 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 02:35 · PVG 10:35 · LAX 19:35 · JFK 22:35
    ♥ Do have faith in what you're doing.