Skip to main content
Http2ServerResponse.prototype.setTimeout - node__http2.d.ts - Node documentation
method Http2ServerResponse.prototype.setTimeout

Usage in Deno

```typescript import { Http2ServerResponse } from "node:node__http2.d.ts"; ```
Http2ServerResponse.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 `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.

Parameters

msecs: number
optional
callback: () => void

Return Type

void