Sending Messages
4:11:06 - 4:19:49 Sending Messages Kyle tasks the audience with adding a setInterval method that will transmit a message to any client connected to the socket. He uses the emit() method to send the message.on the server:
function handleIO(socket){
// "client connected"
// ...
socket.emit("hello", Math.random());
//...
on the client:
socket.on("hello",function(
data
){
console.log(data);
});