deno.com

method Server.prototype.setTimeout

Overload 1

#Server.prototype.setTimeout(
msecs?: number,
callback?: (socket: Socket) => void,
): this

Sets the timeout value for sockets, and emits a 'timeout' event on the Server object, passing the socket as an argument, if a timeout occurs.

If there is a 'timeout' event listener on the Server object, then it will be called with the timed-out socket as an argument.

By default, the Server does not timeout sockets. However, if a callback is assigned to the Server's 'timeout' event, timeouts must be handled explicitly.

Parameters #

#msecs: number = 0 (no timeout)
optional
#callback: (socket: Socket) => void
optional

Return Type #

this

Overload 2

#Server.prototype.setTimeout(callback: (socket: Socket) => void): this

Parameters #

#callback: (socket: Socket) => void

Return Type #

this