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

Function onsendConcat

benchmark/dgram/array-vs-concat.js:30–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 const onsend = type === 'concat' ? onsendConcat : onsendMulti;
29
30 function onsendConcat() {
31 if (sent++ % n === 0) {
32 // The setImmediate() is necessary to have event loop progress on OSes
33 // that only perform synchronous I/O on nonblocking UDP sockets.
34 setImmediate(() => {
35 for (let i = 0; i < n; i++) {
36 socket.send(Buffer.concat(chunk), PORT, '127.0.0.1', onsend);
37 }
38 });
39 }
40 }
41
42 function onsendMulti() {
43 if (sent++ % n === 0) {

Callers

nothing calls this directly

Calls 3

concatMethod · 0.80
sendMethod · 0.65
setImmediateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…