Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
456 stars 169 forks source link

Check if socket is already connected #315

Closed NotoriousBIT closed 1 year ago

NotoriousBIT commented 1 year ago

The RTU Client already does this check, but the TCP one is not. https://github.com/Cloud-Automation/node-modbus/blob/9f0d2e532cb4c09816c1418d70bd93d5b626a404/src/rtu-client-request-handler.ts#L37-L40

stefanpoeter commented 1 year ago

@NotoriousBIT Thanks for the PR. Can you increase the Version number to v4.0.8 in the package.json?

NotoriousBIT commented 1 year ago

@stefanpoeter I did :+1:

stefanpoeter commented 1 year ago

Damn, merged this to soon. The readyState member has been added after node Version 10. So this won't compile with node 10 and below.

stefanpoeter commented 1 year ago

I revert the changes back in v4.0.9.