Socket.io connection resources question

This might be a stupid question, but I am new to WebSockets and still learning about them.

If I have 3 different server connect actions on a page and each of them has the socket connection turned on is this opening 3 different socket connections? Or are they all inside of one connection?

I might be using the wrong terminology, but basically I’m wondering what the best way to setup these server connect actions with sockets to take up the least amount of server resources.

Is it better to have all of the sever actions combined into one with sockets? Does it matter if there are multiple running on the same page?

Very good question Steve!

We actually optimized websockers used by the server connect live refresh to use a single connection, so they should be really fast and light in resource usage.

So if you have many such websocket driven server connects on your page they might be even faster on updates as there is always a direct connection available.

3 Likes

Perfect! Thanks for the quick response.