2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-01-28 15:59:35 -08:00
|
|
|
const common = require('../common');
|
|
|
|
const dgram = require('dgram');
|
2014-07-02 15:24:17 +02:00
|
|
|
|
2014-08-02 15:06:25 +04:00
|
|
|
if (process.platform === 'darwin') {
|
2015-07-06 03:24:12 +00:00
|
|
|
console.log('1..0 # Skipped: because of 17894467 Apple bug');
|
2014-08-02 15:06:25 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-01-28 15:59:35 -08:00
|
|
|
const client = dgram.createSocket('udp4');
|
2014-07-02 15:24:17 +02:00
|
|
|
|
|
|
|
client.bind(common.PORT);
|
|
|
|
|
2015-05-19 13:00:06 +02:00
|
|
|
client.on('message', function(buffer, bytes) {
|
2014-07-02 15:24:17 +02:00
|
|
|
clearTimeout(timer);
|
|
|
|
client.close();
|
|
|
|
});
|
|
|
|
|
2016-01-25 15:00:06 -08:00
|
|
|
const buf = Buffer.alloc(0);
|
2015-05-19 13:00:06 +02:00
|
|
|
client.send(buf, 0, 0, common.PORT, '127.0.0.1', function(err, len) { });
|
2014-07-02 15:24:17 +02:00
|
|
|
|
2016-01-28 15:59:35 -08:00
|
|
|
const timer = setTimeout(function() {
|
2014-07-02 15:24:17 +02:00
|
|
|
throw new Error('Timeout');
|
2016-01-28 15:59:35 -08:00
|
|
|
}, common.platformTimeout(200));
|