feat(net): named pipe support via Deno.pipe#29308
feat(net): named pipe support via Deno.pipe#29308CyanChanges wants to merge 17 commits intodenoland:mainfrom
Deno.pipe#29308Conversation
Help WantedI encountered an issue when working on the node compat: import * as net from 'node:net'
// I have a server listening on this pipe
// ```ts
// const pipe = Deno.pipe.listen({ path: "\\\\.\\pipe\\mypipe1", kind: "windows", pipeMode: "byte" })
// const ab = new Uint8Array(32)
// await pipe.read(ab); // didn't resolve, it resolve to null after the other side closed :skull:
// ```
const conn = new net.createConnection({ path: "\\\\.\\pipe\\mypipe1" })
conn.write("something") // `true`, but do nothing
// if you await here, it will stuck here
/*await */ Deno[Deno.internal].core.write(
/*
If you createConnection immediately after start,
the pipe resource should be assigned a rid of 3
*/
3,
new TextEncoder().encode("test")
)I tried to write it directly via Resource Id, but the promise never resolves, The The Problem Only Appear In Windows (Because the issue aim to support |
nathanwhit
left a comment
There was a problem hiding this comment.
nice, the implementation looks reasonable to me. I'm less sure about the public API changes and the pipe_wrap changes for windows. The pipe_wrap changes seem ok at a glance.
I think the team will have to discuss the new API, and then go from there.
eecec1c to
6929148
Compare
30ae7d5 to
a08662d
Compare
041f75a to
dea1d83
Compare
|
Node compat is kinda broken still, but I wonder if the |
|
Is this |
|
Ok. Thanks for the clarification |
yeah, somehow after put |
|
|
we still needs fs.* stuff's pipe support, but I guess this pr is already able to marge :)
|
|
Guess it would be better to move |
|
I think it should be a Deno API for named pipes for all platforms tho, but anyways |
Co-authored-by: Cyan Changes <contact@cyans.me> Add support to Pipe.prototype.listen, Pipe.prototype.connect for windows with named pipes. Also support to Pipe.prototype.open for unix. Alternative of #29308, but without `Deno:pipe`. Only with node compatibilities. Solution for: #25867 #28332 #31032 Maybe related: #10244 I tested the Nuxt and Nx, they are working fine on Windows now. I also tested node-pty, and it's working on Unix. Co-authored-by: Cyan Changes <contact@cyans.me>





close #10244
Support Named Pipes via
Deno.pipetodos
verify if work in windows (I have no Windows dev machine rn)
update
deno_node'snode:netto useDeno.pipefor Windows- close Not implemented: Pipe.prototype.connect #28332
- close Uncaught Error: Not implemented: Pipe.prototype.listen - Windows #25867
Todo: seems
node:fscompat needs change something to support pipeswould like to do that in another pr
type definitions
add tests