Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/parallel/test-dgram-send-callback-multi-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ const dgram = require('dgram');

const client = dgram.createSocket('udp4');

const messageSent = common.mustCall(function messageSent(err, bytes) {
const messageSent = common.mustCall((err, bytes) => {
assert.strictEqual(bytes, buf1.length + buf2.length);
});

const buf1 = Buffer.alloc(256, 'x');
const buf2 = Buffer.alloc(256, 'y');

client.on('listening', function() {
const port = this.address().port;
client.on('listening', () => {
const port = client.address().port;
client.send([buf1, buf2], port, common.localhostIPv4, messageSent);
});

client.on('message', common.mustCall(function onMessage(buf, info) {
client.on('message', common.mustCall((buf, info) => {
const expected = Buffer.concat([buf1, buf2]);
assert.ok(buf.equals(expected), 'message was received correctly');
client.close();
Expand Down