Skip to content

'close' event is not firing after v8.0.19 #591

@canegru

Description

@canegru

We currently hook into the client.on('close', () => events for our reconnect logic, and after version v8.0.19 the event is not being emitted due to #578 .

I've been able to replicate this issue locally on my own machine as well as in a production environment, reading from a PLC.

await connectionClient.connectTCP(this.configuration.endpointUrl, {
    port: this.configuration.endpointPort ?? 502,
    keepAlive: true,
});
connectionClient.on('close', () => {
    this.logger.log('Modbus connection closed');
});
connectionClient.on('error', () => {
    this.logger.error('Modbus connection error');
});

I'm a bit busy this week, but I can dig into the code if no one has time.

The current fix is to use 8.0.18.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions