Skip to main content

setTimeout

method Http2ServerRequest.prototype.setTimeout
Jump to headingHttp2ServerRequest.prototype.setTimeout(
msecs: number,
callback?: () => void,
): void

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 Http2Streams 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.

Parameters Jump to heading

Jump to headingmsecs: number
optional
Jump to headingcallback: () => void

Return Type Jump to heading

void
Back to top