mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
I assume they aren't meant to be there. PR-URL: https://github.com/nodejs/node/pull/16631 Refs: https://github.com/nodejs/node/pull/15685 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
28 lines
691 B
JavaScript
Executable File
28 lines
691 B
JavaScript
Executable File
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
const http2 = require('http2');
|
|
|
|
const server = http2.createServer();
|
|
server.setTimeout(common.platformTimeout(1));
|
|
|
|
const onServerTimeout = common.mustCall((session) => {
|
|
session.destroy();
|
|
});
|
|
|
|
server.on('stream', common.mustNotCall());
|
|
server.once('timeout', onServerTimeout);
|
|
|
|
server.listen(0, common.mustCall(() => {
|
|
const url = `http://localhost:${server.address().port}`;
|
|
const client = http2.connect(url);
|
|
client.on('close', common.mustCall(() => {
|
|
|
|
const client2 = http2.connect(url);
|
|
client2.on('close', common.mustCall(() => server.close()));
|
|
|
|
}));
|
|
}));
|