MenuMenu

RTCMultiConnection.socketCustomEvent

It is useful for socket.io custom messaging

This method allows you set custom socket listener before starting or joining a room.

How to use

connection.socketCustomEvent = 'abcdef';
connection.openOrJoin('roomid', function() {
    connection.socket.on(connection.socketCustomEvent, function(message) {
        alert(message);
    });

    connection.socket.emit(connection.socketCustomEvent, 'My userid is: ' + connection.userid);
});

Alternative API: setCustomSocketEvent