Do I need to heartbeat to keep a TCP connection open?

前端 未结 15 2070
温柔的废话
温柔的废话 2020-11-27 09:56

I have two components that that communicate via TCP/IP. Component A acts as a server/listener and Component B is the client. The two should communicate as quickly as possi

15条回答
  •  暖寄归人
    2020-11-27 10:22

    If your components:

    • are in a conventional wired network
    • there are no firewalls or NAT routers between them
    • neither of them crash

    then you do not need to have a heartbeat.

    If any of these assumptions are false (I am looking at you, GPRS!), a heartbeat becomes necessary rather quickly.

提交回复
热议问题