When using SocketIO, any message is received like this:
socket.on("eventname", function() {
}
But "eventname" can be literally any line of text.
How did they achieve this? How do they have an event listener for every possible line? Do they add event listeners, how do messages arrive?
I tried reading the SocketIO source code, but it went right above my head.
source
share