Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
shfan
V2EX  ›  Linux

Linux 重启网络服务为什么连接不会断

  •  
  •   shfan · Aug 20, 2021 · 2827 views
    This topic created in 1753 days ago, the information mentioned may be changed or developed.

    操作系统:centos 7,使用 systemctl restart networt 重启网络服务为什么 socket 连接不会断,比如 SSH 连接,抓包也没发现 TCP 有重连,请问这个机制是怎么实现的。

    3 replies    2021-08-22 00:34:45 +08:00
    huangmingyou
        1
    huangmingyou  
       Aug 20, 2021
    因为 tcp 会话信息还在内核里面吧,主要就是 ack 号没乱
    weyou
        2
    weyou  
       Aug 20, 2021 via Android
    重启网络服务的只是接口配置更新,协议栈又不会清空。tcp 连接超时时间足够你重启 n 多次了,只要地址没变,自然不会影响到收发包。你开关一下你家大门会影响快递员送货不?
    anouser
        3
    anouser  
       Aug 22, 2021
    你要是有心跳保持的话,肯定会检测到断线的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4787 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 09:54 · PVG 17:54 · LAX 02:54 · JFK 05:54
    ♥ Do have faith in what you're doing.