From ec6b78ae730362422c03c827013346cff5c78fca Mon Sep 17 00:00:00 2001 From: Clark Kozak Date: Fri, 18 Sep 2020 15:16:59 -0600 Subject: [PATCH] doc: add `socket.readyState` + description of `socket.readyState` Note: YAML tag found in commit e697cfb6fc020c08afa2c794ee5802e5a4d2b97b Co-authored-by: Michael Auderer PR-URL: https://github.com/nodejs/node/pull/35262 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- doc/api/net.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/api/net.md b/doc/api/net.md index 7d70e905be1563..28de44d8897246 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -964,6 +964,20 @@ written out, which may not be immediately. See `Writable` stream [`write()`][stream_writable_write] method for more information. +### `socket.readyState` + + +* {string} + +This property represents the state of the connection as a string. + +* If the stream is connecting `socket.readyState` is `opening`. +* If the stream is readable and writable, it is `open`. +* If the stream is readable and not writable, it is `readOnly`. +* If the stream is not readable and writable, it is `writeOnly`. + ## `net.connect()` Aliases to