Finding the number of connected clients in socket.io

Background Information

Software updates fast, but answers on Stack Overflow (unfortunately) do not.

This test was made to find which answers of this question still work and which answers are outdated.

As nick said, socket.io version 1.0+ added many new features, but most of the information online is from socket.io <1.0

This is The Outdated Manual - most/all of the questions that needed to be asked were asked before version x, and now when people from much later need answers, they get outdated answers at the top, and (if any) the useful answers nearer to the bottom.

Tests

The tests are run on the server side, and the outputs are shown below.

Each test is a link you can click to show where in the Stack Overflow post it was suggested.

Red means that it resulted in an error, gray means that it is wrong (even though it didn't make an error), and green means it got the answer right.

THE VERSION OF SOCKET.IO USED IS 4.1.2

If anything is missing then please comment on the question.