Sending message to specific client with socket.io and empty message queue

后端 未结 9 2019
误落风尘
误落风尘 2020-12-22 20:16

I´m going crazy with socket.io! Documentation is so bad it\'s simply not true.

I want to send a feedback to specific client over socket.io

My server side loo

9条回答
  •  眼角桃花
    2020-12-22 20:41

    i tired with the latest version of node and socket.io below i am going to post complete code

      

      server side code

        var usernames = {};io.on('connection', function(socket){usernames["username"] = socket.id;
      socket.on('drumevent', function(msg){     
      var socketId = socket.id;io.to(socketId).emit('drumevent', data);
      

    提交回复
    热议问题