I have a websocket nodejs server and a client.
I observed that when I force kill -9
the server process, the client connection is automatically closed. How does the client know about it? More importantly, is it even possible for the client to remain connected without knowing the server is dead?
On one hand I think this case might be impossible based on my observation, but on the other hand, without understanding how it works I cannot be too optimistic.
I also tried shutting down a virtualbox machine running the server forcefully (via vagrant halt -f
, also tried kill -9
the virtual machine process on host machine) according to this post: What is the most violent way that an application can terminate itself (linux) and the client websocket connection also magically terminates itself.
Any help would be appreciated.