We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0a2fe4 commit b66c0b6Copy full SHA for b66c0b6
lib/connection.js
@@ -61,10 +61,12 @@ var Connection = function(config) {
61
util.inherits(Connection, EventEmitter);
62
63
Connection.prototype.connect = function(port, host) {
64
-
65
- if(this.stream.readyState === 'closed') {
+ // Old info regarding readyState https://github.com/nodejs/node-v0.x-archive/issues/1752
+ // this previously checked for this.stream.readyState === 'open'
66
+ // however when upgrading to node 14 - LTS readyState was always open
67
+ // which prevented code that connected from being called
68
+ if (port && host) {
69
this.stream.connect(port, host);
- } else if(this.stream.readyState == 'open') {
70
this.emit('connect');
71
}
72
0 commit comments