Skip to content

Instantly share code, notes, and snippets.

@A-gambit
Created February 28, 2016 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save A-gambit/ee99e8bf59731760075a to your computer and use it in GitHub Desktop.
Save A-gambit/ee99e8bf59731760075a to your computer and use it in GitHub Desktop.
//server
io.on('connection', socket => {
//read and send file
......
//update and send data
socket.on('updateFile', data => {
//update your file
...
//send new on client
socket.emit('updateData', data)
})
})
//client
socket.emit('updateFile', data)
socket.on('updateData', data => console.log(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment