Server.prototype.on - Node documentation
method Server.prototype.on

Usage in Deno

import { Server } from "node:net";
Server.prototype.on(
event: string,
listener: (...args: any[]) => void,
): this

Parameters

event: string
listener: (...args: any[]) => void

Return Type

this
Server.prototype.on(
event: "close",
listener: () => void,
): this

Parameters

event: "close"
listener: () => void

Return Type

this
Server.prototype.on(
event: "connection",
listener: (socket: Socket) => void,
): this

Parameters

event: "connection"
listener: (socket: Socket) => void

Return Type

this
Server.prototype.on(
event: "error",
listener: (err: Error) => void,
): this

Parameters

event: "error"
listener: (err: Error) => void

Return Type

this
Server.prototype.on(
event: "listening",
listener: () => void,
): this

Parameters

event: "listening"
listener: () => void

Return Type

this
Server.prototype.on(
event: "drop",
listener: (data?: DropArgument) => void,
): this

Parameters

event: "drop"
listener: (data?: DropArgument) => void

Return Type

this