Closed
Description
Affected URL(s)
https://nodejs.org/api/net.html#new-netsocketoptions
Description of the problem
socket.connect()
is described as accepting the following option:
onread
{Object} If specified, incoming data is stored in a singlebuffer
and passed to the suppliedcallback
when data arrives on the socket.
This will cause the streaming functionality to not provide any data.
The socket will emit events like'error'
,'end'
, and'close'
as usual. Methods likepause()
andresume()
will also behave as
expected.
buffer
{Buffer|Uint8Array|Function} Either a reusable chunk of memory to
use for storing incoming data or a function that returns such.callback
{Function} This function is called for every chunk of incoming
data. Two arguments are passed to it: the number of bytes written to
buffer
and a reference tobuffer
. Returnfalse
from this function to
implicitlypause()
the socket. This function will be executed in the
global context.
However, this is not correct, and is actually accepted only in the Socket()
constructor:
Line 454 in b4e8f1b
The example given using net.connect()
is still correct because the options "Will be passed to both the new net.Socket([options])
call and the socket.connect(options[, connectListener])
method."
Activity