remove timeout on connection open
This commit is contained in:
parent
501b42fc9a
commit
822247e1fa
@ -126,12 +126,8 @@ export default class Connection {
|
||||
|
||||
OnOpen(e: Event) {
|
||||
this.ConnectTimeout = DefaultConnectTimeout;
|
||||
this._InitSubscriptions();
|
||||
console.log(`[${this.Address}] Open!`);
|
||||
setTimeout(() => {
|
||||
if(this.Authed || this.AwaitingAuth.size === 0) {
|
||||
this._InitSubscriptions();
|
||||
}
|
||||
}, 150)
|
||||
}
|
||||
|
||||
OnClose(e: CloseEvent) {
|
||||
@ -349,6 +345,10 @@ export default class Connection {
|
||||
}
|
||||
|
||||
_SendJson(obj: any) {
|
||||
if(!this.Authed && this.AwaitingAuth.size > 0) {
|
||||
this.Pending.push(obj);
|
||||
return;
|
||||
}
|
||||
if (this.Socket?.readyState !== WebSocket.OPEN) {
|
||||
this.Pending.push(obj);
|
||||
return;
|
||||
@ -456,4 +456,4 @@ export default class Connection {
|
||||
}
|
||||
return ev;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user