lib,src: add unix socket getsockname/getpeername
authorBen Noordhuis <info@bnoordhuis.nl>
Wed, 25 Feb 2015 16:19:11 +0000 (17:19 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 27 Aug 2015 15:45:04 +0000 (17:45 +0200)
commitf337595441641ad36f6ab8ae770e56c1673ef692
tree7abaa1634975c873d72f3003c17f996810680e35
parenta43af39ffc369776f776c69e5287c9632349fc2b
lib,src: add unix socket getsockname/getpeername

The implementation is a minor API change in that socket.address() now
returns a `{ address: '/path/to/socket' }` object, like it does for TCP
and UDP sockets.  Before this commit, it returned `socket._pipeName`,
which is a string when present.

Change common.PIPE on Windows from '\\\\.\\pipe\\libuv-test' to
'\\\\?\\pipe\\libuv-test'.  Windows converts the '.' to a '?' when
creating a named pipe, meaning that common.PIPE didn't match the
result from NtQueryInformationFile().

Fixes: https://github.com/nodejs/node/issues/954
PR-URL: https://github.com/nodejs/node/pull/956
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
doc/api/net.markdown
lib/net.js
src/pipe_wrap.cc
src/pipe_wrap.h
test/common.js
test/parallel/test-cluster-http-pipe.js
test/parallel/test-http-unix-socket.js
test/sequential/test-pipe-address.js