Many times it is necessary to know why a socket was disconnected. The JS implementation provides a reason argument for this in the client and the server.
reason