나는 socket.io와 함께이 시나리오를 가지고있다.Socket.io on socket disconnect
소켓은 방을 연결하고 방에 들어가며 그는 주인이다. 다른 소켓이 그의 방에 들어갑니다. 마스터가 연결을 끊으면이 방의 다른 소켓을 모두 차고 싶습니다.
나는이 생각 :socket.on('disconnect', function(data){
// if socket's id == room he is the master and kick other sockets from this
// room and join them to a room of their own identified by their ids.
});
내가 너무 많은 로직없이 응용 프로그램을 실속 루프에 대해이 작업을 수행하고자합니다. io.sockets.leave(socket.room)
과 같은 것이 가능합니까?
당신은 그의 대답을 편집 할 수있었습니다. – mak