node.js - can I set the request timeout to zero for forever wait? -


i'm using npm request module, states in docs:

timeout - integer containing number of milliseconds wait server send response headers (and start response body) before aborting request. note if underlying tcp connection cannot established, os-wide tcp connection timeout overrule timeout option (the default in linux can anywhere 20-120 seconds).

what doesn't state whether can set value zero, traditionally done, indicate want wait forever. doesn't state default value is.

can answer 2 questions?

* addendum *

presuming module uses underlying http library, docs fail clarify point:

request.settimeout(timeout[, callback])#

added in: v0.5.9 timeout milliseconds before request considered timed out. callback optional function called when timeout occurs. same binding timeout event. once socket assigned request , connected socket.settimeout() called.

(from: https://nodejs.org/api/http.html#http_request_settimeout_timeout_callback)


Comments