Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 socket.io 我可以可靠地依靠事件来确定谁在线以及谁丢失或关闭了连接connect?与我联系并确定谁与我自己disconnect联系会更可靠吗?heartbeat
connect
disconnect
heartbeat
谢谢!
一个直接依赖于另一个。如果心跳失败(超时),那么 socket.io 将发出disconnect事件。