4.3.15 socket_join_room_callback
Last updated
Was this helpful?
Last updated
Was this helpful?
room
(String)
callback
(Function)
Returns 连接的Socket
将客户端添加到room
中,并根据需要触发带有err
签名(如果有)的回调。
连接室的机制由已配置的Adapter
(参见上面的 Server#adapter
)处理,默认为。
为了您的方便,每个socket自动连接由其ID标识的房间(请参见Socket#id
)。这使得向其他socket广播消息变得容易: