mafintosh / webrtc-swarm

Create a swarm of p2p connections using webrtc and a signalhub
MIT License
380 stars 60 forks source link

Deferred emission of stream events received before emitting connect event #26

Open delapuente opened 6 years ago

delapuente commented 6 years ago

Fix #25

This is an initial draft of the solution. Since simple-peer has no support for lazy-adding streams, let's store the stream sent by the peer inside the peer.

delapuente commented 6 years ago

Another solution would be to delay these events until emitting the peer event. What do you think @mafintosh ?

delapuente commented 6 years ago

I've implemented delaying the events until after the peer event. What do you think, @mafintosh ?

delapuente commented 6 years ago

@perguth I changed the way of clean-up. Let me know your thoughts and thanks for the feedback.