Fix issue where client sessions were closed without status updates
This commit is contained in:
6
main.js
6
main.js
@@ -212,6 +212,7 @@ class ClientSession {
|
||||
auto_enquire_link_period: this.auto_enquire_link_period,
|
||||
}, this.connected.bind(this));
|
||||
this.session.on('error', this.error.bind(this));
|
||||
this.session.on('close', this.closed.bind(this));
|
||||
} catch (e) {
|
||||
this.logger.log1("Client connection failed to " + this.url);
|
||||
this.setStatus(ClientSessionStatus.NOT_CONNECTED);
|
||||
@@ -224,6 +225,11 @@ class ClientSession {
|
||||
return this.connectingPromise.promise;
|
||||
}
|
||||
|
||||
closed() {
|
||||
this.logger.log1(`Client closed connection to ${this.url}`);
|
||||
this.setStatus(ClientSessionStatus.NOT_CONNECTED);
|
||||
}
|
||||
|
||||
error(error) {
|
||||
if (error.code === "ETIMEOUT") {
|
||||
this.logger.log1("Client connection timed out to " + this.url);
|
||||
|
Reference in New Issue
Block a user