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