Skip to main content
Socket.prototype.once - dgram - Node documentation
method Socket.prototype.once

Usage in Deno

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

Parameters

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

Return Type

this
Socket.prototype.once(
event: "close",
listener: () => void,
): this

Parameters

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

Return Type

this
Socket.prototype.once(
event: "connect",
listener: () => void,
): this

Parameters

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

Return Type

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

Parameters

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

Return Type

this
Socket.prototype.once(
event: "listening",
listener: () => void,
): this

Parameters

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

Return Type

this
Socket.prototype.once(
event: "message",
listener: (
msg: Buffer,
rinfo: RemoteInfo,
) => void
,
): this

Parameters

event: "message"
listener: (
msg: Buffer,
rinfo: RemoteInfo,
) => void

Return Type

this
Back to top