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