()
| 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) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…