You have to implement your own logic. However, you can count numbers of
clients in a room by this:
This will return an array of Socket instances of all clients in the
room. Check if the length of this array is greater or less than 2. If a new
client wants to join a room which already has 2 client then you can easily
prevent him from doing this. Hope this would work for you.