Is TCP Keepalive the only mechanism to determine a broken link?

后端 未结 5 950
北荒
北荒 2021-01-13 14:46

I recently ran into a issue where intermediate link betweeen a TCP server and client was down. The client has the requirement of connecting to a secondary server if the prim

5条回答
  •  误落风尘
    2021-01-13 15:39

    Even without SO_KEEPALIVE set, if you try to send data along a dead tcp connection, it typically gets reset, or will eventually time out - either of these sends an error to the application eventually.

    SO_KEEPALIVE means that this may be detected sooner on an otherwise idle connection. That's all.

提交回复
热议问题