Merge pull request #186 from brugeman/main

Fix races where Socket is closed before Websocket is created
This commit is contained in:
2023-02-01 19:20:21 +00:00
committed by GitHub

View File

@ -107,6 +107,11 @@ export default class Connection {
console.warn("Could not load relay information", e); console.warn("Could not load relay information", e);
} }
if (this.IsClosed) {
this._UpdateState();
return;
}
this.IsClosed = false; this.IsClosed = false;
this.Socket = new WebSocket(this.Address); this.Socket = new WebSocket(this.Address);
this.Socket.onopen = (e) => this.OnOpen(e); this.Socket.onopen = (e) => this.OnOpen(e);