How Does Event Emitter Pattern Work In Node , Sockets.io?
I am trying to get my hands on node ,reading through the book node.js in action ,I am came across this bit of code which is to be written on server side. var socketio = require('so
Solution 1:
This is a custom event, triggered by the other side. In this server side example, server waits for the client sends rooms
event, and in the callback it responds with rooms
event as well. Client in turn can also listen for rooms
event.
You could name these events as you want. It is not necessary that both these events are named rooms
.
Post a Comment for "How Does Event Emitter Pattern Work In Node , Sockets.io?"