fix: ack callback call twice

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-03-24 14:52:50 +08:00
parent b71ce1b24d
commit 662e70b72c
5 changed files with 33 additions and 28 deletions

View File

@@ -65,7 +65,7 @@ export class Client extends EventEmitter implements SocketIO.Client {
packet(packet: Packet, opts?: any) {
this.conn.send(parser.encode(packet))
}
onclose(reason: string) {
onclose(reason?: string) {
// debug('client close with reason %s', reason);
// ignore a potential subsequent `close` event
this.destroy();
@@ -77,8 +77,8 @@ export class Client extends EventEmitter implements SocketIO.Client {
}
this.sockets = {};
// this.decoder.destroy(); // clean up decoder
};
close() {
}
disconnect() {
// if ('open' == this.conn.readyState) {
// debug('forcing transport close');
this.conn.close();