summaryrefslogtreecommitdiff
path: root/test/parallel/test-dgram-send-callback-recursive.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-dgram-send-callback-recursive.js')
-rw-r--r--test/parallel/test-dgram-send-callback-recursive.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/parallel/test-dgram-send-callback-recursive.js b/test/parallel/test-dgram-send-callback-recursive.js
index 63edd5e587..c54b05c3f8 100644
--- a/test/parallel/test-dgram-send-callback-recursive.js
+++ b/test/parallel/test-dgram-send-callback-recursive.js
@@ -9,17 +9,19 @@ let received = 0;
let sent = 0;
const limit = 10;
let async = false;
+let port;
function onsend() {
if (sent++ < limit) {
- client.send(
- chunk, 0, chunk.length, common.PORT, common.localhostIPv4, onsend);
+ client.send(chunk, 0, chunk.length, port, common.localhostIPv4, onsend);
} else {
assert.strictEqual(async, true, 'Send should be asynchronous.');
}
}
client.on('listening', function() {
+ port = this.address().port;
+
setImmediate(function() {
async = true;
});
@@ -38,4 +40,4 @@ client.on('close', common.mustCall(function() {
assert.equal(received, limit);
}));
-client.bind(common.PORT);
+client.bind(0);