mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

Also, change setServerBusy into a setter PR-URL: https://github.com/nodejs/node/pull/34247 Reviewed-By: Anna Henningsen <anna@addaleax.net>
32 lines
656 B
JavaScript
32 lines
656 B
JavaScript
// Flags: --no-warnings
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasQuic)
|
|
common.skip('missing quic');
|
|
|
|
const assert = require('assert');
|
|
const {
|
|
key,
|
|
cert,
|
|
ca,
|
|
} = require('../common/quic');
|
|
|
|
const { createQuicSocket } = require('net');
|
|
|
|
const options = { key, cert, ca, alpn: 'zzz' };
|
|
|
|
const server = createQuicSocket({ server: options });
|
|
|
|
server.on('busy', common.mustCall(() => {
|
|
throw new Error('boom');
|
|
}));
|
|
|
|
server.on('close', common.mustCall());
|
|
|
|
server.on('error', common.mustCall((err) => {
|
|
assert.strictEqual(err.message, 'boom');
|
|
}));
|
|
|
|
assert.strictEqual(server.serverBusy, false);
|
|
server.serverBusy = true;
|