This commit is contained in:
Dave Horton
2022-05-02 11:12:39 -04:00
parent 5134d5dbc6
commit daa02ac55a

View File

@@ -128,9 +128,9 @@ class WsRequestor extends BaseRequestor {
close() {
this.closedByUs = true;
this.logger.info('WsRequestor:close closing socket');
try {
if (this.ws) {
this.logger.info('WsRequestor:close closing socket');
this.ws.close();
this.ws.removeAllListeners();
}
@@ -194,10 +194,10 @@ class WsRequestor extends BaseRequestor {
}
_onOpen(ws) {
this.logger.info({url: this.url}, 'WsRequestor - successfully connected');
if (this.ws) this.logger.info({old_ws: this.ws._socket.address()}, 'WsRequestor:_onOpen');
assert(!this.ws);
this.emit('ready', ws);
this.logger.info({url: this.url}, 'WsRequestor - successfully connected');
}
_onClose() {