• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4if (!common.hasIPv6)
5  common.skip('IPv6 support required');
6
7const initHooks = require('./init-hooks');
8const verifyGraph = require('./verify-graph');
9const http = require('http');
10
11const hooks = initHooks();
12hooks.enable();
13
14const server = http.createServer(common.mustCall((req, res) => {
15  res.end();
16  server.close(common.mustCall());
17}));
18server.listen(0, common.mustCall(() => {
19  http.get({
20    host: '::1',
21    family: 6,
22    port: server.address().port
23  }, common.mustCall());
24}));
25
26process.on('exit', () => {
27  hooks.disable();
28
29  verifyGraph(
30    hooks,
31    [ { type: 'TCPSERVERWRAP',
32        id: 'tcpserver:1',
33        triggerAsyncId: null },
34      { type: 'TCPWRAP', id: 'tcp:1', triggerAsyncId: 'tcpserver:1' },
35      { type: 'TCPCONNECTWRAP',
36        id: 'tcpconnect:1',
37        triggerAsyncId: 'tcp:1' },
38      { type: 'HTTPCLIENTREQUEST',
39        id: 'httpclientrequest:1',
40        triggerAsyncId: 'tcpserver:1' },
41      { type: 'TCPWRAP', id: 'tcp:2', triggerAsyncId: 'tcpserver:1' },
42      { type: 'HTTPINCOMINGMESSAGE',
43        id: 'httpincomingmessage:1',
44        triggerAsyncId: 'tcp:2' },
45      { type: 'Timeout',
46        id: 'timeout:1',
47        triggerAsyncId: 'httpincomingmessage:1' },
48      { type: 'SHUTDOWNWRAP',
49        id: 'shutdown:1',
50        triggerAsyncId: 'tcp:2' } ]
51  );
52});
53