Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
465 stars 174 forks source link

responseDelay for server #216

Closed biancode closed 6 years ago

biancode commented 6 years ago

Hi Stefan,

the response delay of the server is missing in my case in v3. That was a great option to simulate slow devices with the server. Is it possible to get that feature back into v3?

cya Klaus

stefanpoeter commented 6 years ago

Hi Klaus, sorry for the late reply, i am pretty busy right now.

This feature should be easy to implement, feel free to make a pull request.

stefanpoeter commented 6 years ago

I've given this some thoughts: I think it is better to extend the socket module and overrride the send method to handle a response delay. This way you would have a common socket response module that is usable with jsmodbus and many other modules. And it shouldn't be that hard to implement.