You are reading a single comment by @hygy and its replies. Click here to read the full conversation.
I'm not sure, how is this workaround working. The setTimeout runs timeout, but the http.get need to be wayted, while it calls the callback. But if we are there, then something is happend, whay it is called the callback, and if the callback called after 10 minutes, it will wait 10 minutes.
And I cannot se, where this errTimeout kill the original http call/socket, if timed out.
It is asyncronous...
http.getonly calls the callback once the socket is open and it's received the header from the web server. If there's a failure then the connect handler won't be called.
... however there is no error handling at the moment. In node.js you'd do:
and we don't do anything like that yet. The code will upload, but the error handler will never get called.
... to be honest I'm not sure it's that high priority, as you can work around it with:
Basically if something stalled, the socket would have timed out after 60 seconds anyway and closed.