Skip to main content

on

method Socket.prototype.on
Jump to headingSocket.prototype.on(
event: string,
listener: (...args: any[]) => void,
): this

Parameters Jump to heading

Jump to headingevent: string
Jump to headinglistener: (...args: any[]) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "close",
listener: (hadError: boolean) => void,
): this

Parameters Jump to heading

Jump to headingevent: "close"
Jump to headinglistener: (hadError: boolean) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "connect",
listener: () => void,
): this

Parameters Jump to heading

Jump to headingevent: "connect"
Jump to headinglistener: () => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "connectionAttempt",
listener: (
ip: string,
port: number,
family: number,
) => void
,
): this

Parameters Jump to heading

Jump to headingevent: "connectionAttempt"
Jump to headinglistener: (
ip: string,
port: number,
family: number,
) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "connectionAttemptFailed",
listener: (
ip: string,
port: number,
family: number,
) => void
,
): this

Parameters Jump to heading

Jump to headingevent: "connectionAttemptFailed"
Jump to headinglistener: (
ip: string,
port: number,
family: number,
) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "connectionAttemptTimeout",
listener: (
ip: string,
port: number,
family: number,
) => void
,
): this

Parameters Jump to heading

Jump to headingevent: "connectionAttemptTimeout"
Jump to headinglistener: (
ip: string,
port: number,
family: number,
) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "data",
listener: (data: Buffer) => void,
): this

Parameters Jump to heading

Jump to headingevent: "data"
Jump to headinglistener: (data: Buffer) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "drain",
listener: () => void,
): this

Parameters Jump to heading

Jump to headingevent: "drain"
Jump to headinglistener: () => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "end",
listener: () => void,
): this

Parameters Jump to heading

Jump to headingevent: "end"
Jump to headinglistener: () => void

Return Type Jump to heading

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

Parameters Jump to heading

Jump to headingevent: "error"
Jump to headinglistener: (err: Error) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "lookup",
listener: (
err: Error,
address: string,
family: string | number,
host: string,
) => void
,
): this

Parameters Jump to heading

Jump to headingevent: "lookup"
Jump to headinglistener: (
err: Error,
address: string,
family: string | number,
host: string,
) => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "ready",
listener: () => void,
): this

Parameters Jump to heading

Jump to headingevent: "ready"
Jump to headinglistener: () => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.on(
event: "timeout",
listener: () => void,
): this

Parameters Jump to heading

Jump to headingevent: "timeout"
Jump to headinglistener: () => void

Return Type Jump to heading

this
Back to top