it should still fix some issue Death of a socket changes its behavior in several ways, so these methods are both valid :) With both methods you actually check those parts of the socket's behavior that change after disconnection.
Hope that helps Make sure that heartbeats is set to true (the default). If the timeout lapses, disconnect should happen automatically. However, there was a bug report about heartbeats not working. Make sure you have the latest version of Socket.IO (I'm not sure the status of the bug). If you still need help, you could send a ping to the old connection when the user tries to reconnect:
Any of those help boost::asio::ip::tcp::socket has a is_open() method which seems to give the result. However, you should be aware that between calling is_open and then sending data with send, the socket can be closed. In addition, TCP write functions usually return immediately after copying the data into the kernel buffer. If sending fails, you will get an error at the next send.
How to check socket is alive (connected) in socket.io with multiple nodes and socket.io-redis