mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00

* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
28 lines
659 B
JavaScript
28 lines
659 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), 'message was received correctly');
|
|
clearInterval(interval);
|
|
client.close();
|
|
}));
|
|
|
|
client.on('listening', common.mustCall(function() {
|
|
interval = setInterval(function() {
|
|
client.send([], client.address().port, common.localhostIPv4);
|
|
}, 10);
|
|
}));
|
|
|
|
client.bind(0);
|