Any hint would be great, ThanksI'm working wit socket.io. I'am on the event acknowledgment part of the stuff. My acknowledment's callback lead to the following returns on my Nodejs console. RxJS is one of the hottest libraries in web development today. Offering a powerful, functional approach for dealing with events and with integration points into a growing number of frameworks, libraries, and utilities, the case for learning Rx has never been more appealing.
Socket Io Emit Cheat Sheet Printable
socket.js
Socket Io Emit Cheat Sheet Pdf
io.on('connection',function(socket){ |
/* 'connection' is a special event fired on the server when any new connection is made */ |
}) |
socket.on('disconnect',function(){ |
/* When this individual socket has disconnected, this special event fires */ |
}) |
/* This will send the event 'foobar' with the data to |
every connected to socket */ |
io.emit('foobar',data) |
/* This will send the event 'foobar' with the data object to |
every connected socket EXCEPT for the socket this is called on */ |
socket.broadcast.emit('foobar',data) |
socket.on('foobar',function(data){ |
/* Fires whenever this socket receives an event 'foobar'. |
You can access the data received inside this callback*/ |
}) |
/* This will send the event 'foobar' with the data to the server */ |
socket.emit('foobar',data) |
socket.id// A unique string identifying this socket connection |
Socket Emit
Socket Io Emit
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment