request.setTimeout(msecs, callback)
msecs
<number>callback
<Function>- 返回: <http2.Http2ServerRequest>
将 Http2Stream
的超时值设置为 msecs
。
如果提供了回调,则将其添加为响应对象上 'timeout'
事件的监听器。
如果没有 'timeout'
监听器被添加到请求、响应或服务器中,则当它们超时时 Http2Stream
s 将被销毁。
如果将句柄分配给请求、响应或服务器的 'timeout'
事件,则必须显式处理超时套接字。
msecs
<number>callback
<Function>- Returns: <http2.Http2ServerRequest>
Sets the Http2Stream
's timeout value to msecs
. If a callback is
provided, then it is added as a listener on the 'timeout'
event on
the response object.
If no 'timeout'
listener is added to the request, the response, or
the server, then Http2Stream
s are destroyed when they time out. If a
handler is assigned to the request, the response, or the server's 'timeout'
events, timed out sockets must be handled explicitly.