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

Function writeData

test/sequential/test-async-wrap-getasyncid.js:264–281  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

262
263 req.oncomplete = common.mustCall(writeData);
264 function writeData() {
265 const wreq = new stream_wrap.WriteWrap();
266 wreq.handle = handle;
267 wreq.oncomplete = () => {
268 handle.shutdown(sreq);
269 testInitialized(sreq, 'ShutdownWrap');
270 };
271 const err = handle.writeLatin1String(wreq, 'hi'.repeat(100000));
272 if (err)
273 throw new Error(`write failed: ${getSystemErrorName(err)}`);
274 if (!stream_wrap.streamBaseState[stream_wrap.kLastWriteWasAsync]) {
275 testUninitialized(wreq, 'WriteWrap');
276 // Synchronous finish. Write more data until we hit an
277 // asynchronous write.
278 return writeData();
279 }
280 testInitialized(wreq, 'WriteWrap');
281 }
282 req.address = common.localhostIPv4;
283 req.port = server.address().port;
284 const err = handle.connect(req, req.address, req.port);

Callers

nothing calls this directly

Calls 3

testUninitializedFunction · 0.85
testInitializedFunction · 0.70
getSystemErrorNameFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…