Skip to content

Commit

Permalink
doc: server.listen truncates socket path on unix
Browse files Browse the repository at this point in the history
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: #6659
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Alexander Makarenko <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
jeanregisser authored and Myles Borins committed Jul 12, 2016
1 parent ef43d39 commit 6408be3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6408be3

Please sign in to comment.