MCPcopy Index your code
hub / github.com/nodejs/node / writevGeneric

Function writevGeneric

lib/internal/stream_base_commons.js:121–144  ·  view source on GitHub ↗
(self, data, cb)

Source from the content-addressed store, hash-verified

119}
120
121function writevGeneric(self, data, cb) {
122 const req = createWriteWrap(self[kHandle], cb);
123 const allBuffers = data.allBuffers;
124 let chunks;
125 if (allBuffers) {
126 chunks = data;
127 for (let i = 0; i < data.length; i++)
128 data[i] = data[i].chunk;
129 } else {
130 chunks = new Array(data.length << 1);
131 for (let i = 0; i < data.length; i++) {
132 const entry = data[i];
133 chunks[i * 2] = entry.chunk;
134 chunks[i * 2 + 1] = entry.encoding;
135 }
136 }
137 const err = req.handle.writev(req, chunks, allBuffers);
138
139 // Retain chunks
140 if (err === 0) req._chunks = chunks;
141
142 afterWriteDispatched(req, err, cb);
143 return req;
144}
145
146function writeGeneric(self, data, encoding, cb) {
147 const req = createWriteWrap(self[kHandle], cb);

Callers 2

net.jsFile · 0.85
[kWriteGeneric]Method · 0.85

Calls 3

afterWriteDispatchedFunction · 0.85
createWriteWrapFunction · 0.70
writevMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…