Repository navigation
docs clarification #1080
Description
Activity
persist until unlinkedis true, and this unlinking is performed on server close. So you are right, there is an ambiguity in this section in terms of who unlinks the pipe. Would you be interested in improving it through a PR?I am not sure how exactly the windows (external) behavior is different from UNIX,
/cc @nodejs/platform-windows@boneskull - a PR in progress to address your concerns.
Does it have something to do with garbage collection, or the socket object falling out of scope...?
I did the below check and determined that the
collectionis done by the operating system, not Node.js . As you can see, the named pipe is removed when the program is abruptly terminated. This is different from UNIX where the DOMAIN socket persists on such abrupt termination. So the reference count is maintained by Windows.var net = require('net') const p= '\\\\.\\pipe\\test.sock' console.log(p) var k = net.createServer((s) => { s.end('hello!') }).listen(p, () => { var socket = net.connect(p) socket.on('data', (d) => { // k.close() }) })
$ node 1080.js \\.\pipe\test.sock ^C // kill abruptly $from the powershell:
PS> [System.IO.Directory]::GetFiles("\\.\\pipe\\") | grep test \\.\\pipe\\test.sock PS> [System.IO.Directory]::GetFiles("\\.\\pipe\\") | grep test PS>Hoep this helps!
@boneskull - have a look at the PR and see if you believe the changes meets your expected clarity and coverage.
- added a commit that references this issue
on Apr 6, 2018 closing as addressed.
- added a commit that references this issue
on Apr 6, 2018 - added a commit that references this issue
on Apr 12, 2018
I'm checking out the documentation on IPC connections, but the wording is unclear to me.
It says (basically) that a named pipe in UNIX "persist until unlinked". This seems to imply that one must manually unlink when finished using it. This is untrue, because calling
close()on theServerobject will apparently do so for you (?).In Windows, it claims pipes will "not persist", and are removed "when the last reference to them is closed". How exactly does this differ from the UNIX behavior? Does it have something to do with garbage collection, or the socket object falling out of scope...?
Thanks!