Closed AurelienC closed 7 years ago
Hey @AurelienC,
i am currently on vacation and can not reproduce your error. Can you post some code. That might help.
Hello,
I have not much time now for work on this fault. Enjoy your vacation ;-) 🏖
My code is really simple. Maybe, sometime, I try to stop connection before to be connected.
// Creation (into method)
this.client = modbus.client.tcp.complete({
host: this.equipment.connection.ip,
port: this.equipment.connection.port,
autoReconnect: true,
// logEnabled: true,
// logLevel: 'debug',
reconnectTimeout: 10000,
timeout: 2000,
unitId: this.equipment.connection.id,
});
// Connection (into method)
this.client.connect();
// Close (into method)
this.client.close()
You should wait with the this.client.close
call after the connection is established. The client emits a online
signal when connected.
Sorry for delay but my time is very restricted on this project.
I have make a better code and I no longer have this error now.
If I have more time, I will try to propose a pull request with a solution.
Thanks for your package @stefanpoeter 🖐
Hi,
I'm using this package with Meteor.JS and I have an throwing exception.
My client is created and the state is
init
.I'm just calling
myEquipment.close();
The line into the package file.
Maybe the socket has been not created, if I close before ? But, it will be good if a test will made before calling
socket.end()
intoclose
function ? What did you think about this ?Thanks ! :-)