socketio / socket.io-p2p

MIT License
1.02k stars 180 forks source link

Signaling in rooms crashes due to foreach function not returning as intended. Bodge provided #69

Closed twofingerrightclick closed 3 years ago

twofingerrightclick commented 3 years ago

I am trying to do signaling in rooms. I looked to the "p2p-snake" example and the socket-io-p2p documentation for how to pass the P2P server the socket and the room, however both the my code and the p2p-snake example crash here at line 25 of socket.io-p2p-server's index.js: image The socket.on('offers') call back's foreach is able to get a undefined peer client when it goes for it in the clients array - client=clients[client.id]. In my code the connectedClients only contains one client - the one that equals the socket in if (client !== socket) as my p2p server currently starts signaling as soon as the client connects. In the p2p-snake code, it crashes immediately as well once one client is connected.

twofingerrightclick commented 3 years ago

The dependent modulesocket.io-p2p-server's bug is solved here: tomcartwrightuk/socket.io-p2p-server#8 image