diff options
author | Thomas Watson <w@tson.dk> | 2020-03-27 18:00:43 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-04-05 07:43:08 +0300 |
commit | 04b71848af97ff3ea917eb281768a5b14823ee2c (patch) | |
tree | e1fb6899da217f9463d50d067b7b913ccb5febdc /doc/api/net.md | |
parent | 251b08d4e85fce0a9cda6536a112b6153bd56a5a (diff) |
doc: document that server.address() can return null
PR-URL: https://github.com/nodejs/node/pull/32519
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc/api/net.md')
-rw-r--r-- | doc/api/net.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/api/net.md b/doc/api/net.md index a7b6eff6008..51a1b8b48ec 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -114,7 +114,7 @@ Emitted when the server has been bound after calling [`server.listen()`][]. added: v0.1.90 --> -* Returns: {Object|string} +* Returns: {Object|string|null} Returns the bound `address`, the address `family` name, and `port` of the server as reported by the operating system if listening on an IP socket @@ -138,7 +138,8 @@ server.listen(() => { }); ``` -Don't call `server.address()` until the `'listening'` event has been emitted. +`server.address()` returns `null` before the `'listening'` event has been +emitted or after calling `server.close()`. ### `server.close([callback])` <!-- YAML |