-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node: implement dgram.Socket APIs #18324
Comments
Will take a look if no-one is already on this? |
TODO:
|
I'm sorely missing the implementation of the rest of dgram's methods, someone please! |
I looked at the source code and I see that the methods in the list above, have already been released. But I still can't use the libraries that depend on Here is for an example code that works in Node but doesn't work in Deno: import dgram from "node:dgram";
const socket = dgram.createSocket({
type: "udp4",
reuseAddr: true,
});
socket.bind(5353)
socket.on("error", (err) => {
console.error(err);
}); When running in Deno, I get this error:
@cmorten maybe you can help me figure out the problem? |
Hi @hey-ab 👋 Trying to refresh mem as this was a while ago! From what I can see the TODO list I posted still stands - much of the dgram module internals is yet to be implemented (requires porting C code to Deno APIs). R.E. your specific issue, I think it’s most likely due to the socket address reuse capability never being implemented, see https://github.com/denoland/deno/blob/main/ext/node/polyfills/internal_binding/udp_wrap.ts#L322 |
Hmm... That's sad, unfortunately I've never written in Rust and won't be able to help out. 😢 |
When I say Deno APIs I meant JS/TS using the That said if there’s functionality that is required which Deno doesn’t support then yes, some Rust needed. If this is documented that the UDP/dgram layer is fully supported then yes would agree that is misleading. |
dgram.Socket
is needed to run multicast-dns in compat mode. (feature request from community)socket.addMembership()
socket.addSourceSpecificMembership()
socket.dropMembership()
socket.dropSourceSpecificMembership()
socket.setBroadcast()
socket.setMulticastInterface()
socket.setMulticastLoopback()
socket.setMulticastTtl()
socket.setTtl()
socket.ref()
fix(ext/node): UdpSocket ref and unref #21777socket.unref()
fix(ext/node): UdpSocket ref and unref #21777The text was updated successfully, but these errors were encountered: