Socket.io delay in firing the “disconnect” event?

后端 未结 2 675
时光说笑
时光说笑 2020-12-11 06:44

I have a socket.io client connected to a node.js server. If I kill node.js at the command line, the client immediately freezes (i.e., communication stops), but there is a ~2

相关标签:
2条回答
  • 2020-12-11 06:56

    I think this is likely a design pattern. The client may be presuming the server is 'temporarily' unreachable (network trafic etc) and essentially will keep trying to reach it... until the client timeout kicks in.

    I send a disconnect (socket.disconnect()) to the server directly from the client, and I don't get this issue.

    0 讨论(0)
  • 2020-12-11 07:08

    Yes. close timeout .

    0 讨论(0)
提交回复
热议问题