node-modbus-serial icon indicating copy to clipboard operation
node-modbus-serial copied to clipboard

Enhancement needed for ports implementation

Open yarosdev opened this issue 4 years ago • 2 comments

It would be great to be possible passing "connection/client" to the port instead of creating inside.

For example, modbus slave is connecting to the server via modem or etc, and server have to pass its socket to the port.

Something like that would be great:

var TcpPort = function(ip, options) {
    var modbus = this;
    ...
    this._client = options.socket || new net.Socket();
    ...
}

yarosdev avatar Feb 19 '21 20:02 yarosdev

Sounds great :+1: Can you make a pull request implementing it ?

yaacov avatar Feb 19 '21 21:02 yaacov

Sounds great 👍 Can you make a pull request implementing it ?

Yes

yarosdev avatar Feb 20 '21 18:02 yarosdev