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

后端 未结 9 2012
误落风尘
误落风尘 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条回答
  •  萌比男神i
    2020-12-22 20:50

    2 things

    1) You should really place your io.sockets.on(..) outside your app/update route to prevent adding multiple listeners for clients.

    2) io.sockets.socket(id); should not be used, it should have been socket.emit('new', 'hello')

提交回复
热议问题