Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket name of unix domain sockets #954

Closed
timkuijsten opened this issue Feb 25, 2015 · 7 comments
Closed

socket name of unix domain sockets #954

timkuijsten opened this issue Feb 25, 2015 · 7 comments
Labels
feature request Issues that request new features to be added to Node.js. help wanted Issues that need assistance from volunteers or PRs that need help to proceed. libuv Issues and PRs related to the libuv dependency or the uv binding. net Issues and PRs related to the net subsystem. stalled Issues and PRs that are stalled.

Comments

@timkuijsten
Copy link
Contributor

It is currently impossible to get the path of a connected unix domain socket. socket.address() returns an empty object if it's not connected over AFINET.

I've looked at lib/net.js, src/tcp_wrap.cc, src/pipe_wrap.cc and libuv and it looks like libuv has support for returning the name of the socket and it is only pipe_wrap.cc that misses something like GetPeerName (I'm not a C coder so I might be wrong on this).

(also filed at nodejs/node-v0.x-archive#9120 a while ago)

@mscdex mscdex added enhancement net Issues and PRs related to the net subsystem. labels Mar 9, 2015
bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Mar 21, 2015
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: nodejs#954
@timkuijsten
Copy link
Contributor Author

Wow, until now I didn't know this issue was being worked on and solved. Great work and an example of how active this community is compared with joyent/node where this issue is still untouched.

@brendanashworth
Copy link
Contributor

Should this be reopened because the patch hasn't landed yet?

@brendanashworth brendanashworth added the feature request Issues that request new features to be added to Node.js. label Jul 4, 2015
@silverwind
Copy link
Contributor

Yeah I think so, sorry for prematurely closing this. PR is here: #956

@silverwind silverwind reopened this Jul 5, 2015
@brendanashworth
Copy link
Contributor

No problem, the patch almost went in before it was deemed semver-major anyways.

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Aug 27, 2015
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: nodejs#954
PR-URL: nodejs#956
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
@bnoordhuis
Copy link
Member

Fixed by f337595.

@bnoordhuis
Copy link
Member

Reverted in de88255, reopening.

@bnoordhuis bnoordhuis reopened this Aug 27, 2015
@Trott Trott mentioned this issue Apr 1, 2016
4 tasks
@Trott Trott added stalled Issues and PRs that are stalled. help wanted Issues that need assistance from volunteers or PRs that need help to proceed. libuv Issues and PRs related to the libuv dependency or the uv binding. labels Apr 5, 2016
@bnoordhuis
Copy link
Member

Closing, see #12907 - the current behavior of returning a string has been documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. help wanted Issues that need assistance from volunteers or PRs that need help to proceed. libuv Issues and PRs related to the libuv dependency or the uv binding. net Issues and PRs related to the net subsystem. stalled Issues and PRs that are stalled.
Projects
None yet
Development

No branches or pull requests

6 participants