簡體   English   中英

向套接字2.0中的某些套接字ID發送消息

[英]Emit message to certain socket id in socket 2.0

我正在使用套接字2.0進行聊天,我想從服務器端向我存儲在數組中的某個套接字ID發送消息。 我該怎么做,我在socket.io文檔中看不到它。

來自: https : //socket.io/docs/emit-cheatsheet/

// sending to individual socketid (private message)
  socket.to(<socketid>).emit('hey', 'I just met you');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM