diff options
author | Rich Trott <rtrott@gmail.com> | 2020-02-07 23:44:48 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-02-10 04:37:01 +0300 |
commit | 6f14db4cbf4e34d8e6ddb8c8eb0cbd1d458dd21d (patch) | |
tree | bf367a7bf320b8126edc4666c79af2659060f4fa /doc/api/net.md | |
parent | 0649225be47647b63a029ba3b64eadc517b06d05 (diff) |
doc,net: reword Unix domain path paragraph in net.md
Reword the paragraph on Unix domain paths. Hopefully, it is a little bit
more clear and easier to read now.
PR-URL: https://github.com/nodejs/node/pull/31684
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/api/net.md')
-rw-r--r-- | doc/api/net.md | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/doc/api/net.md b/doc/api/net.md index bb5a55e0e48..84bda5e4e9b 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -26,18 +26,16 @@ sockets on other operating systems. [`socket.connect()`][] take a `path` parameter to identify IPC endpoints. On Unix, the local domain is also known as the Unix domain. The path is a -filesystem pathname. It gets truncated to a length of -`sizeof(sockaddr_un.sun_path) - 1`, which varies 91 and 107 bytes depending on -the operating system. The typical values are 107 on Linux and 103 on macOS. The -path is subject to the same naming conventions and permissions checks as would -be done on file creation. If the Unix domain socket (that is visible as a file -system path) is created and used in conjunction with one of Node.js' API -abstractions such as [`net.createServer()`][], it will be unlinked as part of -[`server.close()`][]. On the other hand, if it is created and used outside of -these abstractions, the user will need to manually remove it. The same applies -when the path was created by a Node.js API but the program crashes abruptly. -In short, a Unix domain socket once successfully created will be visible in the -filesystem, and will persist until unlinked. +filesystem pathname. It gets truncated to an OS-dependent length of +`sizeof(sockaddr_un.sun_path) - 1`. Typical values are 107 bytes on Linux and +103 bytes on macOS. If a Node.js API abstraction creates the Unix domain socket, +it will unlink the Unix domain socket as well. For example, +[`net.createServer()`][] may create a Unix domain socket and +[`server.close()`][] will unlink it. But if a user creates the Unix domain +socket outside of these abstractions, the user will need to remove it. The same +applies when a Node.js API creates a Unix domain socket but the program then +crashes. In short, a Unix domain socket will be visible in the filesystem and +will persist until unlinked. On Windows, the local domain is implemented using a named pipe. The path *must* refer to an entry in `\\?\pipe\` or `\\.\pipe\`. Any characters are permitted, |