mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 04:41:47 +00:00

Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
24 lines
435 B
JavaScript
24 lines
435 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const dgram = require('dgram');
|
|
|
|
const socket = dgram.createSocket('udp4');
|
|
|
|
socket.bind();
|
|
|
|
let fired = false;
|
|
const timer = setTimeout(function() {
|
|
socket.close();
|
|
}, 100);
|
|
|
|
socket.on('listening', function() {
|
|
clearTimeout(timer);
|
|
fired = true;
|
|
socket.close();
|
|
});
|
|
|
|
socket.on('close', function() {
|
|
assert(fired, 'listening should fire after bind');
|
|
});
|