You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{strictEqual}from"node:assert";import{createSocket}from"node:dgram";import{networkInterfaces}from"node:os";importprocessfrom"node:process";constisWindows=process.platform==="win32";functionlinklocal(){for(const[ifname,entries]ofObject.entries(networkInterfaces())){for(const{ address, family, scopeid }ofentries){if(family==="IPv6"&&address.startsWith("fe80:")){return{ address, ifname, scopeid };}}}}constiface=linklocal();if(!iface){process.exit(0);}constaddress=isWindows ? iface.address : `${iface.address}%${iface.ifname}`;constmessage="Hello, local world!";// Create a client socket for sending to the link-local address.constclient=createSocket("udp6");// Create the server socket listening on the link-local address.constserver=createSocket("udp6");server.on("listening",()=>{constport=server.address().port;client.send(message,0,message.length,port,address);},);server.on("message",(buf,info)=>{constreceived=buf.toString();strictEqual(received,message);// Check that the sender address is the one bound,// including the link local scope identifier.strictEqual(info.address,isWindows ? `${iface.address}%${iface.scopeid}` : address,);server.close();client.close();},);server.bind({ address });
Output:
error: Uncaught Error: bind UNKNOWN fe80::1%lo0
at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:93:9)
at __node_internal_exceptionWithHostPort (ext:deno_node/internal/errors.ts:217:10)
at node:dgram:273:20
at Array.processTicksAndRejections (ext:deno_node/_next_tick.ts:36:15)
at eventLoopTick (ext:core/01_core.js:165:29)
Expect no output, and for the program to exit cleanly.
The text was updated successfully, but these errors were encountered:
…x the ones that fail) (#24631)
The intent is that those tests will be executed, but our check that the
files are up to date won't overwrite the contents of the tests. This is
useful when a test needs some manual edits to work.
It turns out we weren't actually running them.
---
This ended up turning into a couple of small bug fixes to get the tests
passing:
- We weren't canonicalizing the exec path properly (it sometimes still
had `..` or `.` in it)
- We weren't accepting strings in `process.exit`
There was one failure I couldn't figure out quickly, so I disabled the
test for now, and filed a follow up issue: #24694
…x the ones that fail) (#24631)
The intent is that those tests will be executed, but our check that the
files are up to date won't overwrite the contents of the tests. This is
useful when a test needs some manual edits to work.
It turns out we weren't actually running them.
---
This ended up turning into a couple of small bug fixes to get the tests
passing:
- We weren't canonicalizing the exec path properly (it sometimes still
had `..` or `.` in it)
- We weren't accepting strings in `process.exit`
There was one failure I couldn't figure out quickly, so I disabled the
test for now, and filed a follow up issue: #24694
Repro:
Output:
Expect no output, and for the program to exit cleanly.
The text was updated successfully, but these errors were encountered: