-
-
Save amandeepmittal/bff64cf186bbd565d5ac7a0de3319d42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
io.on('connection', socket => { | |
socket.emit('request' /* … */); // emit an event to the socket | |
io.emit('broadcast' /* … */); // emit an event to all connected sockets | |
socket.on('reply', () => { | |
/* … */ | |
}); // listen to the event | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment