- Token-1 | Trying to connect the server;
- If Token-1 is not already connected | Token is not found in users[] array list;
- Create a user object with token and connection id and push to users[] array list;
- Complete the flow.
- Token-1 | Trying to connect the server;
- If Token-1 is already connected | Token is found in users[] array list;
- Push the connection ID to the existing user object from users[] array list;
- Complete the flow.
- Wait a few seconds for any responses from the dropped client;
- If the client is not responding, remove the dropped connection ID from the user object;
- If the user's all the browser sessions (connection IDs) are disconnected and no any connections from the connection array on user object the user object should be removed from the users[] array list.