When to Write a New Socket

Learn when to write a new Socket or use the same topic.

We'll cover the following...

Writing a new Socket

We’ve written two Sockets so far, UserSocket and AuthSocket, and we wrote Channels for each of them. This raises the question of when we should create a new Socket versus using the same topic and adding a new Channel. We’ll make this decision based primarily on the authentication needs of our application. There are also performance costs to adding new Sockets; let’s look at these costs first.

Each connected Socket adds one connection to the server, but each connected Channel adds zero new connections. Channels do take ...