1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

BREAKING(net/unstable): remove Deno.DatagramConn.rid (#22475)

As part of ongoing efforts to remove `rid` properties from the public
API. Note: this property is undocumented.
This commit is contained in:
Asher Gomez 2024-02-19 16:24:38 +11:00 committed by GitHub
parent 7e6b942312
commit 7531b3500a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -372,17 +372,13 @@ class Datagram {
this.bufSize = bufSize;
}
get rid() {
return this.#rid;
}
get addr() {
return this.#addr;
}
async joinMulticastV4(addr, multiInterface) {
await op_net_join_multi_v4_udp(
this.rid,
this.#rid,
addr,
multiInterface,
);
@ -390,19 +386,19 @@ class Datagram {
return {
leave: () =>
op_net_leave_multi_v4_udp(
this.rid,
this.#rid,
addr,
multiInterface,
),
setLoopback: (loopback) =>
op_net_set_multi_loopback_udp(
this.rid,
this.#rid,
true,
loopback,
),
setTTL: (ttl) =>
op_net_set_multi_ttl_udp(
this.rid,
this.#rid,
ttl,
),
};
@ -410,7 +406,7 @@ class Datagram {
async joinMulticastV6(addr, multiInterface) {
await op_net_join_multi_v6_udp(
this.rid,
this.#rid,
addr,
multiInterface,
);
@ -418,13 +414,13 @@ class Datagram {
return {
leave: () =>
op_net_leave_multi_v6_udp(
this.rid,
this.#rid,
addr,
multiInterface,
),
setLoopback: (loopback) =>
op_net_set_multi_loopback_udp(
this.rid,
this.#rid,
false,
loopback,
),
@ -438,7 +434,7 @@ class Datagram {
switch (this.addr.transport) {
case "udp": {
this.#promise = op_net_recv_udp(
this.rid,
this.#rid,
buf,
);
if (this.#unref) core.unrefOpPromise(this.#promise);
@ -449,7 +445,7 @@ class Datagram {
case "unixpacket": {
let path;
({ 0: nread, 1: path } = await op_net_recv_unixpacket(
this.rid,
this.#rid,
buf,
));
remoteAddr = { transport: "unixpacket", path };
@ -466,13 +462,13 @@ class Datagram {
switch (this.addr.transport) {
case "udp":
return await op_net_send_udp(
this.rid,
this.#rid,
{ hostname: opts.hostname ?? "127.0.0.1", port: opts.port },
p,
);
case "unixpacket":
return await op_net_send_unixpacket(
this.rid,
this.#rid,
opts.path,
p,
);
@ -482,7 +478,7 @@ class Datagram {
}
close() {
core.close(this.rid);
core.close(this.#rid);
}
ref() {