denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
96.98k stars 5.35k forks source link

Invalid argument #17202

Open puzzle-rusher opened 1 year ago

puzzle-rusher commented 1 year ago

deno 1.29.1 (release, x86_64-apple-darwin)

TypeError: Invalid argument (os error 22) at async Listener.accept (deno:ext/net/01_net.js:147:44)

const conn = Deno.listen({
    transport: "unix",
    path: "/tmp/.dextradeinput.sock"
});
let sock = await conn.accept();

When someone writes in unix domain socket stream.

sebastiano-barrera commented 1 year ago

I think I'm going to take a crack at this issue, but I can't reproduce it. I tried the following steps:

  1. deno run --unstable sample.js, where the content of sample.js is the code block from your comment.
  2. Sent some data to the UNIX domain socket, with echo asdlol | nc -U /tmp/.dextradeinput.sock.

The script works with no error of any sort on both the 1.29.1 release and on the latest commit on main (c230a955), both freshly built.

Can you clarify what steps produce the issue for you?