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

Function main

benchmark/http2/respond-with-fd.js:17–42  ·  view source on GitHub ↗
({ requests, streams, clients, duration })

Source from the content-addressed store, hash-verified

15}, { flags: ['--no-warnings'] });
16
17function main({ requests, streams, clients, duration }) {
18 fs.open(file, 'r', (err, fd) => {
19 if (err)
20 throw err;
21
22 const http2 = require('http2');
23 const server = http2.createServer();
24 server.on('stream', (stream) => {
25 stream.respondWithFD(fd);
26 stream.on('error', (err) => {});
27 });
28 server.listen(0, () => {
29 bench.http({
30 path: '/',
31 requests,
32 port: server.address().port,
33 maxConcurrentStreams: streams,
34 clients,
35 duration,
36 threads: clients,
37 }, () => server.close());
38 });
39
40 });
41
42}

Callers

nothing calls this directly

Calls 8

respondWithFDMethod · 0.80
listenMethod · 0.80
httpMethod · 0.80
openMethod · 0.65
addressMethod · 0.65
closeMethod · 0.65
requireFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected