[ 
https://issues.apache.org/jira/browse/THRIFT-2968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15766790#comment-15766790
 ] 

ASF GitHub Bot commented on THRIFT-2968:
----------------------------------------

Github user guptanishank commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1141#discussion_r93419768
  
    --- Diff: lib/nodejs/lib/thrift/http_connection.js ---
    @@ -214,6 +214,18 @@ HttpConnection.prototype.write = function(data) {
       var req = (self.https) ?
           https.request(self.nodeOptions, self.responseCallback) :
           http.request(self.nodeOptions, self.responseCallback);
    +
    +  //support for timeout
    +  var timeout = self.nodeOptions.timeout;
    +  if(timeout){
    +    req.on('socket', function (socket) {
    +        socket.setTimeout(timeout);  
    +        socket.on('timeout', function() {
    +            req.abort();
    +        });
    +    });
    +  }
    --- End diff --
    
    @nsuke  One workaround could be to use a different option like 
"socketTimeout" and mention in documentation that this option is for node 
versions not having support for timeout.
    
    Also, could you look patch submitted in this JIRA ticket: THRIFT-2968


> nodejs: http connection socket timeout option
> ---------------------------------------------
>
>                 Key: THRIFT-2968
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2968
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Node.js - Library
>            Reporter: Andrew de Andrade
>            Priority: Trivial
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to