Socket io. Disable automatical joining a room identified by socket's id
<p>In docs it is said: "Each Socket in Socket.IO is identified by a random, unguessable, unique identifier Socket#id. For your convenience, each socket automatically joins a room identified by this id."</p>

<p>I am wondering if there is an option to disable such feature.
My solution was:</p>

<pre><code>io.on('connection', function (socket) {
    leaveDefRoom(socket);
[...]
}

function leaveDefRoom(socket){
    var room = socket.adapter.rooms;
    for (var key in room){
        if (key.charAt(0) == '/') {
            socket.leave(key);
            return;
        }
    }
}
</code></pre>