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

chore: rename internal Datagram class to DatagramConn (#22474)

As having mismatched public and private class names may be confusing,
without good reason, to those unfamiliar with the codebase.
This commit is contained in:
Asher Gomez 2024-03-20 03:03:15 +10:00 committed by GitHub
parent b0c687c1d2
commit b9f8562754
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -360,7 +360,7 @@ class Listener {
}
}
class Datagram {
class DatagramConn {
#rid = 0;
#addr = null;
#unref = false;
@ -553,7 +553,7 @@ function createListenDatagram(udpOpFn, unixOpFn) {
args.loopback ?? false,
);
addr.transport = "udp";
return new Datagram(rid, addr);
return new DatagramConn(rid, addr);
}
case "unixpacket": {
const { 0: rid, 1: path } = unixOpFn(args.path);
@ -561,7 +561,7 @@ function createListenDatagram(udpOpFn, unixOpFn) {
transport: "unixpacket",
path,
};
return new Datagram(rid, addr);
return new DatagramConn(rid, addr);
}
default:
throw new TypeError(`Unsupported transport: '${transport}'`);