Socket#emit(name:String[, …]):Socket
Emits an event to the socket identified by the string name
. Any other parameters can be included.
All datastructures are supported, including Buffer
. JavaScript functions can’t be serialized/deserialized.
1 2 3 4 | var io = require( 'socket.io' )(); io.on( 'connection' , function (socket){ socket.emit( 'an event' , { some: 'data' }); }); |
Please login to continue.