cvmts: nope I have to fix it properly
This commit is contained in:
@@ -78,10 +78,7 @@ export class User {
|
|||||||
if (!this.socket.isOpen()) return;
|
if (!this.socket.isOpen()) return;
|
||||||
clearInterval(this.nopSendInterval);
|
clearInterval(this.nopSendInterval);
|
||||||
this.nopSendInterval = setInterval(() => this.sendNop(), 5000);
|
this.nopSendInterval = setInterval(() => this.sendNop(), 5000);
|
||||||
this.socket.send(msg)
|
this.socket.send(msg);
|
||||||
.catch((err: Error) => {
|
|
||||||
this.logger.Error(`bandaid fix: ${err.message}`);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private onNoMsg() {
|
private onNoMsg() {
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ export default class WSClient extends EventEmitter implements NetworkClient {
|
|||||||
}
|
}
|
||||||
send(msg: string): Promise<void> {
|
send(msg: string): Promise<void> {
|
||||||
return new Promise((res,rej) => {
|
return new Promise((res,rej) => {
|
||||||
|
if(!this.isOpen())
|
||||||
|
res();
|
||||||
|
|
||||||
this.socket.send(msg, (err) => {
|
this.socket.send(msg, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
rej(err);
|
rej(err);
|
||||||
@@ -49,4 +52,4 @@ export default class WSClient extends EventEmitter implements NetworkClient {
|
|||||||
this.socket.close();
|
this.socket.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user