Skip to content

Commit

Permalink
Fix reconnecting by always accepting new ice candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
schlagmichdoch committed Feb 14, 2024
1 parent 722822a commit 2503dba
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions public/scripts/network.js
Expand Up @@ -1162,25 +1162,19 @@ class RTCPeer extends Peer {
}

_handleLocalCandidate(candidate) {
if (this.localIceCandidatesSent) return;

Logger.debug("RTC: Local candidate created", candidate);

if (candidate === null) {
this.localIceCandidatesSent = true;
return;
}

this._sendSignal({ signalType: 'candidate', candidate: candidate });
}

async _handleRemoteCandidate(candidate) {
if (this.remoteIceCandidatesReceived) return;

Logger.debug("RTC: Received remote candidate", candidate);

if (candidate === null) {
this.remoteIceCandidatesReceived = true;
return;
}

Expand Down Expand Up @@ -1261,8 +1255,6 @@ class RTCPeer extends Peer {
this._conn.close();
this._conn = null;
}
this.localIceCandidatesSent = false;
this.remoteIceCandidatesReceived = false;
}

_sendMessage(message) {
Expand Down

0 comments on commit 2503dba

Please sign in to comment.