Lines Matching refs:req
45 function handleWriteReq(req, data, encoding) {
46 const { handle } = req;
51 const ret = handle.writeBuffer(req, data);
53 req.buffer = data;
58 return handle.writeLatin1String(req, data);
61 return handle.writeUtf8String(req, data);
63 return handle.writeAsciiString(req, data);
68 return handle.writeUcs2String(req, data);
72 const ret = handle.writeBuffer(req, buffer);
74 req.buffer = buffer;
110 const req = new WriteWrap();
112 req.handle = handle;
113 req.oncomplete = onWriteComplete;
114 req.async = false;
115 req.bytes = 0;
116 req.buffer = null;
117 req.callback = callback;
119 return req;
123 const req = createWriteWrap(self[kHandle], cb);
138 const err = req.handle.writev(req, chunks, allBuffers);
141 if (err === 0) req._chunks = chunks;
143 afterWriteDispatched(req, err, cb);
144 return req;
148 const req = createWriteWrap(self[kHandle], cb);
149 const err = handleWriteReq(req, data, encoding);
151 afterWriteDispatched(req, err, cb);
152 return req;
155 function afterWriteDispatched(req, err, cb) {
156 req.bytes = streamBaseState[kBytesWritten];
157 req.async = !!streamBaseState[kLastWriteWasAsync];
160 return cb(errnoException(err, 'write', req.error));
162 if (!req.async && typeof req.callback === 'function') {
163 req.callback();