'use of io.Manager class in socket.io

Socket.io has provided docs about io.Manager class. It also tells about how to make a manager object. But it does not use this manager object anywhere in any example.

I want to ask whether this Manager class has any practical use or not. Since I am new to Socket.io, it would be helpful if someone tell the use of manager object with an example in layman way. If there is no direct use of manager object in making an application, then confirm it also.



Solution 1:[1]

See these docs: https://socket.io/docs/v4/client-api/#manager

The Manager manages the Engine.IO client instance, which is the low-level engine that establishes the connection to the server (by using transports like WebSocket or HTTP long-polling). The Manager handles the reconnection logic. A single Manager can be used by several Sockets.

Please note that, in most cases, you won't use the Manager directly but use the Socket instance instead.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Maria Ines Parnisari