mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 14:56:19 +00:00

Update test-https-agent-session-reuse.js PR-URL: https://github.com/nodejs/node/pull/16028 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
29 lines
666 B
JavaScript
29 lines
666 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (common.isOSX)
|
|
common.skip('because of 17894467 Apple bug');
|
|
|
|
const assert = require('assert');
|
|
const dgram = require('dgram');
|
|
|
|
const client = dgram.createSocket('udp4');
|
|
|
|
let interval;
|
|
|
|
client.on('message', common.mustCall(function onMessage(buf, info) {
|
|
const expected = Buffer.alloc(0);
|
|
assert.ok(buf.equals(expected), `Expected empty message but got ${buf}`);
|
|
clearInterval(interval);
|
|
client.close();
|
|
}));
|
|
|
|
client.on('listening', common.mustCall(function() {
|
|
interval = setInterval(function() {
|
|
client.send([], client.address().port, common.localhostIPv4);
|
|
}, 10);
|
|
}));
|
|
|
|
client.bind(0);
|