From b7ee893d9e92ff0f111c54dc3a8801902275ae9c Mon Sep 17 00:00:00 2001 From: Jean Regisser Date: Mon, 9 May 2016 19:33:09 +0200 Subject: [PATCH] doc: server.listen truncates socket path on unix Internally it ends up calling `uv_pipe_bind` with the given path which itself is documented to truncate the path. See http://docs.libuv.org/en/v1.x/pipe.html#c.uv_pipe_bind This is NOT a bug, but a restriction of the unix socket api, as it stores the path in `sockaddr_un.sun_path` (104 chars on OS X, 108 chars on Linux), see `man unix`. PR-URL: https://github.com/nodejs/node/pull/6659 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Alexander Makarenko Reviewed-By: Anna Henningsen --- doc/api/net.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/api/net.md b/doc/api/net.md index 466cacaece33f1..7f07b69dc210b0 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -153,9 +153,12 @@ This function is asynchronous. When the server has been bound, will be added as a listener for the [`'listening'`][] event. On UNIX, the local domain is usually known as the UNIX domain. The path is a -filesystem path name. It is subject to the same naming conventions and -permissions checks as would be done on file creation, will be visible in the -filesystem, and will *persist until unlinked*. +filesystem path name. It gets truncated to `sizeof(sockaddr_un.sun_path)` +bytes, decreased by 1. It varies on different operating system between 91 and +107 bytes. The typical values are 107 on Linux and 103 on OS X. The path is +subject to the same naming conventions and permissions checks as would be done +on file creation, 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,