Skip to content

Commit

Permalink
Hotfix: avoid connection leak of ethernet-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilherme Francescon committed Jan 15, 2020
1 parent fd7c8a4 commit 35f28d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Version 1.1.1
- Hotfix - Avoids connection leak of 'ethernet-ip'

## Version 1.1.0
- Implements Node-RED 1.0 API
- Changes node's category to "plc"
Expand Down
3 changes: 3 additions & 0 deletions red/ethernet-ip.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
*/

const net = require('net');

function nrInputShim(node, fn) {
function doErr(err) { err && node.error(err) }
node.on('input', function (msg, send, done) {
Expand Down Expand Up @@ -226,6 +228,7 @@ module.exports = function (RED) {
//TODO remove listeners
node._plc.removeListener("error", onControllerError);
node._plc.removeListener("end", onControllerEnd);
net.Socket.prototype.destroy.call(node._plc);
node._plc = null;
}
}
Expand Down

0 comments on commit 35f28d4

Please sign in to comment.