Skip to content
Console
llms.txtUser help

@fkn/lib/dgram

Node’s dgram.Socket through the relay, without bindSync and connectSync: the relay binds and connects asynchronously, so the class does not claim to implement Node’s.

  • EventEmitter
new Socket(options): Socket;

SocketOptions & EventEmitterOptions & RelayOption & object

Socket

EventEmitter.constructor
asyncDispose: Promise<void>;

Promise<void>

addMembership(multicastAddress, multicastInterface?): void;

string

string

void

address(): AddressInfo;

AddressInfo

addSourceSpecificMembership(
sourceAddress,
groupAddress,
multicastInterface?): void;

Not implemented by the browser transport. This method currently does nothing.

string

string

string

void

bind(
port?,
address?,
callback?): this;

number

string

() => void

this

bind(port?, callback?): this;

number

() => void

this

bind(callback?): this;

() => void

this

bind(options, callback?): this;

BindOptions

() => void

this

close(callback?): this;

() => void

this

connect(
port,
address?,
callback?): void;

number

string

() => void

void

connect(port, callback): void;

number

() => void

void

disconnect(): void;

void

dropMembership(multicastAddress, multicastInterface?): void;

string

string

void

dropSourceSpecificMembership(
sourceAddress,
groupAddress,
multicastInterface?): void;

Not implemented by the browser transport. This method currently does nothing.

string

string

string

void

getRecvBufferSize(): number;

number

getSendBufferSize(): number;

number

getSendQueueCount(): number;

Queue measurements are not exposed by the browser transport. Always returns 0.

number

getSendQueueSize(): number;

Queue measurements are not exposed by the browser transport. Always returns 0.

number

ref(): this;

No-op in a browser, which has no Node process-liveness handle.

this

remoteAddress(): AddressInfo;

AddressInfo

send(
msg,
port?,
address?,
callback?): void;

string | readonly any[] | Uint8Array<ArrayBufferLike>

number

string

(error, bytes) => void

void

send(
msg,
port?,
callback?): void;

string | readonly any[] | Uint8Array<ArrayBufferLike>

number

(error, bytes) => void

void

send(msg, callback?): void;

string | readonly any[] | Uint8Array<ArrayBufferLike>

(error, bytes) => void

void

send(
msg,
offset,
length,
port?,
address?,
callback?): void;

string | Uint8Array<ArrayBufferLike>

number

number

number

string

(error, bytes) => void

void

send(
msg,
offset,
length,
port?,
callback?): void;

string | Uint8Array<ArrayBufferLike>

number

number

number

(error, bytes) => void

void

send(
msg,
offset,
length,
callback?): void;

string | Uint8Array<ArrayBufferLike>

number

number

(error, bytes) => void

void

send(
msg,
offset?,
length?,
port?,
address?,
callback?): void;

unknown

unknown

unknown

unknown

unknown

unknown

void

setBroadcast(flag): void;

boolean

void

setMulticastInterface(multicastInterface): void;

No-op. The browser transport does not expose an interface index or address.

string

void

setMulticastLoopback(flag): boolean;

boolean

boolean

setMulticastTTL(ttl): number;

number

number

setRecvBufferSize(size): void;

number

void

setSendBufferSize(size): void;

number

void

setTTL(ttl): number;

number

number

unref(): this;

No-op in a browser, which has no Node process-liveness handle.

this

default: object;
createSocket: (options, callback?) => Socket;

SocketType | SocketOptions & RelayOption

(msg, rinfo) => void

Socket

Socket: typeof Socket;
function createSocket(options, callback?): Socket;

SocketType | SocketOptions & RelayOption

(msg, rinfo) => void

Socket