request.setTimeout(timeout[, callback])


一旦套接字被分配给这个请求并被连接,则 socket.setTimeout() 将被调用。

  • timeout <number> Milliseconds before a request times out.
  • callback <Function> Optional function to be called when a timeout occurs. Same as binding to the 'timeout' event.
  • Returns: <http.ClientRequest>

Once a socket is assigned to this request and is connected socket.setTimeout() will be called.