request.setTimeout(timeout[, callback])


  • timeout <number> 请求超时前的毫秒数。

    ¥timeout <number> Milliseconds before a request times out.

  • callback <Function> 发生超时时要调用的可选函数。与绑定到 'timeout' 事件相同。

    ¥callback <Function> Optional function to be called when a timeout occurs. Same as binding to the 'timeout' event.

  • 返回:<http.ClientRequest>

    ¥Returns: <http.ClientRequest>

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

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