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

Function onsend

benchmark/dgram/multi-buffer.js:28–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26 const socket = dgram.createSocket('udp4');
27
28 function onsend() {
29 if (sent++ % n === 0) {
30 // The setImmediate() is necessary to have event loop progress on OSes
31 // that only perform synchronous I/O on nonblocking UDP sockets.
32 setImmediate(() => {
33 for (let i = 0; i < n; i++) {
34 socket.send(chunk, PORT, '127.0.0.1', onsend);
35 }
36 });
37 }
38 }
39
40 socket.on('listening', () => {
41 bench.start();

Callers 2

mainFunction · 0.70
mainFunction · 0.70

Calls 2

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…