Networks are unreliable. Put more precisely, TCP networking can experience many different types of failures with resulting loss of connectivity. Do not let the linked post’s title fool you, it goes on to list a number of real-world computer networking failures. HTTP is a great way to communicate over the public internet, where failures may occur at any time, because the protocol itself is stateless and does not rely on a persistent connection. HTML5 WebSockets, however, do use a persistent TCP connection. A connection that can cut or closed without warning. Today’s post is a short commentary on adding error handlers and heartbeat messaging to WebSocket clients and servers.
...