From 81379d1a006684e6b23d6fd41c6807b948cd85f4 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 72324760f88fc5..4d7f031d2cd70d 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -1028,6 +1028,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