-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Comments
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
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. |
Should this be reopened because the patch hasn't landed yet? |
Yeah I think so, sorry for prematurely closing this. PR is here: #956 |
No problem, the patch almost went in before it was deemed semver-major anyways. |
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>
Fixed by f337595. |
Reverted in de88255, reopening. |
Closing, see #12907 - the current behavior of returning a string has been documented. |
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)
The text was updated successfully, but these errors were encountered: