Skip to content

Conversation

@schlagmichdoch
Copy link
Contributor

@schlagmichdoch schlagmichdoch commented Jan 6, 2023

Error

Often the following error is logged:

Failed to execute 'setLocalDescription' on 'RTCPeerConnection': Failed to set local answer sdp: Called in wrong state: stable

(See: #555 #542 #532 #345 #258 #252 #249 #247 #233 #194 #24)

Cause

I discovered that sockets are not properly closed when a peer leaves and quickly rejoines

Fix

This PR fixes the closing of sockets:

  • In the method _onPeerLeft(peerId): The property peer._peer must be peer._conn.
  • Do not reopen the channel after closing by setting peer._channel.onclose = null

Additionally this PR closes all p2p connections when the websocket connection is closed.

Stability

Together with #528, #537 and #531 this increases the stabilty a lot on my instance

dxlliv added a commit to dxlliv/snapshare that referenced this pull request May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant