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: 'Timeout', id: 'timeout:1', triggerAsyncId: 'tcp:2' }, 43 { type: 'HTTPINCOMINGMESSAGE', 44 id: 'httpincomingmessage:1', 45 triggerAsyncId: 'tcp:2' }, 46 { type: 'Timeout', 47 id: 'timeout:1', 48 triggerAsyncId: 'httpincomingmessage:1' }, 49 { type: 'SHUTDOWNWRAP', 50 id: 'shutdown:1', 51 triggerAsyncId: 'tcp:2' } ] 52 ); 53}); 54