Skip to main content
Socket.prototype.emit - net - Node documentation
method Socket.prototype.emit

Usage in Deno

import { Socket } from "node:net";
Socket.prototype.emit(
event: string | symbol,
...args: any[],
): boolean

Parameters

event: string | symbol
...args: any[]

Return Type

boolean
Socket.prototype.emit(
event: "close",
hadError: boolean,
): boolean

Parameters

event: "close"
hadError: boolean

Return Type

boolean
Socket.prototype.emit(event: "connect"): boolean

Parameters

event: "connect"

Return Type

boolean
Socket.prototype.emit(
event: "connectionAttempt",
ip: string,
port: number,
family: number,
): boolean

Parameters

event: "connectionAttempt"
ip: string
port: number
family: number

Return Type

boolean
Socket.prototype.emit(
event: "connectionAttemptFailed",
ip: string,
port: number,
family: number,
): boolean

Parameters

event: "connectionAttemptFailed"
ip: string
port: number
family: number

Return Type

boolean
Socket.prototype.emit(
event: "connectionAttemptTimeout",
ip: string,
port: number,
family: number,
): boolean

Parameters

event: "connectionAttemptTimeout"
ip: string
port: number
family: number

Return Type

boolean
Socket.prototype.emit(
event: "data",
data: Buffer,
): boolean

Parameters

event: "data"
data: Buffer

Return Type

boolean
Socket.prototype.emit(event: "drain"): boolean

Parameters

event: "drain"

Return Type

boolean
Socket.prototype.emit(event: "end"): boolean

Parameters

event: "end"

Return Type

boolean
Socket.prototype.emit(
event: "error",
err: Error,
): boolean

Parameters

event: "error"
err: Error

Return Type

boolean
Socket.prototype.emit(
event: "lookup",
err: Error,
address: string,
family: string | number,
host: string,
): boolean

Parameters

event: "lookup"
err: Error
address: string
family: string | number
host: string

Return Type

boolean
Socket.prototype.emit(event: "ready"): boolean

Parameters

event: "ready"

Return Type

boolean
Socket.prototype.emit(event: "timeout"): boolean

Parameters

event: "timeout"

Return Type

boolean