Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change request timeout #34

Closed
mbahaa opened this issue Dec 17, 2014 · 1 comment
Closed

Change request timeout #34

mbahaa opened this issue Dec 17, 2014 · 1 comment

Comments

@mbahaa
Copy link

mbahaa commented Dec 17, 2014

According to this: http://nodejs.org/api/http.html#http_request_settimeout_timeout_callback
http sockets are automatically closed after 120 seconds of inactivity by default, how is it possible to send an http RPC request throught jayson with any desired timeout (more than 120 seconds of course)

I used:

this.rpcClient = jayson.client.http({
port: port,
hostname: ip
});

this.rpcClient.on('http request', function(req){
req.setTimeout(VALUE) ;
});

but did not work for me

@tedeh
Copy link
Owner

tedeh commented Jan 2, 2015

707c714 sees too it that http requests that timeout automatically abort. So you will get an error when this happens. See the added test in the referred commit for a working example quite similar to your own.

@tedeh tedeh closed this as completed Jan 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants