Browse Source

doc: add docs for server.address() for pipe case

Add documentation for net.server.address() for the case it is listening
on a pipe or unix domain socket instead an IP socket.

PR-URL: https://github.com/nodejs/node/pull/12907
Fixes: https://github.com/nodejs/node/issues/12895
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
v6.x
Flarna 8 years ago
committed by Myles Borins
parent
commit
c01a2d545e
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 5
      doc/api/net.md

5
doc/api/net.md

@ -58,11 +58,14 @@ added: v0.1.90
--> -->
Returns the bound address, the address family name, and port of the server Returns the bound address, the address family name, and port of the server
as reported by the operating system. as reported by the operating system if listening on an IP socket.
Useful to find which port was assigned when getting an OS-assigned address. Useful to find which port was assigned when getting an OS-assigned address.
Returns an object with `port`, `family`, and `address` properties: Returns an object with `port`, `family`, and `address` properties:
`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` `{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`
For a server listening on a pipe or UNIX domain socket, the name is returned
as a string.
Example: Example:
```js ```js

Loading…
Cancel
Save