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

后端 未结 5 932
北荒
北荒 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:23

    I always handled this at the application level by extended the protocol talked via TCP between client and servers with "Keep Alive"-Messages server and client send this message e.g. each second and if they have not got "Keep Alive"-Message within 2 seconds, connection is probably closed.

    The Keep-Alive mechanism of TCP is fine, but difficult to use especially when working on different platforms.

提交回复
热议问题