Skip to content

Commit 5885f46

Browse files
committed
net: fix new net.Socket documentation
`Socket` no longer accepts `type` option, and also accepts `readable`, `writable` options. fix #6541
1 parent 5ce50ec commit 5885f46

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/api/net.markdown

+6-4
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,14 @@ Construct a new socket object.
281281
`options` is an object with the following defaults:
282282

283283
{ fd: null
284-
type: null
285-
allowHalfOpen: false
284+
allowHalfOpen: false,
285+
readable: false,
286+
writable: false
286287
}
287288

288-
`fd` allows you to specify the existing file descriptor of socket. `type`
289-
specified underlying protocol. It can be `'tcp4'`, `'tcp6'`, or `'unix'`.
289+
`fd` allows you to specify the existing file descriptor of socket.
290+
Set `readable` and/or `writable` to `true` to allow reads and/or writes on this
291+
socket (NOTE: Works only when `fd` is passed).
290292
About `allowHalfOpen`, refer to `createServer()` and `'end'` event.
291293

292294
### socket.connect(port, [host], [connectListener])

0 commit comments

Comments
 (0)