A common way is to create a room name based on the users in that room.
So if your uid is ron
and mine is puf
, we end up in a room puf_ron
.
Note that I ordered the uids before concatenating, so that they are in the same order no matter who happened to end up first in the list of users.
This approach doesn't require keeping track of what rooms a user is in and ensures that the same two (or more) users always end up in the same room.