This is an automated email from the ASF dual-hosted git repository.
jking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new 234e80e THRIFT-4844: createConnection ignores connect_timeout option
234e80e is described below
commit 234e80e1b9acb1bc778c7adfaa6cb695d922d5f0
Author: fmalaguti <[email protected]>
AuthorDate: Thu Apr 4 15:05:26 2019 +0200
THRIFT-4844: createConnection ignores connect_timeout option
---
lib/nodejs/lib/thrift/connection.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/nodejs/lib/thrift/connection.js
b/lib/nodejs/lib/thrift/connection.js
index 72ecb69..25e34ed 100644
--- a/lib/nodejs/lib/thrift/connection.js
+++ b/lib/nodejs/lib/thrift/connection.js
@@ -256,7 +256,11 @@ Connection.prototype.connection_gone = function () {
};
exports.createConnection = function(host, port, options) {
- var stream = net.createConnection(port, host);
+ var stream = net.createConnection( {
+ port: port,
+ host: host,
+ timeout: options.connect_timeout || options.timeout || 0
+ });
var connection = new Connection(stream, options);
connection.host = host;
connection.port = port;