blob: f6254ec43e90d640742af22d69083a89cc6b90b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
'use strict';
const common = require('../common');
const assert = require('assert');
const dgram = require('dgram');
const client = dgram.createSocket('udp4');
const buf = Buffer.alloc(256, 'x');
const onMessage = common.mustSucceed((bytes) => {
assert.strictEqual(bytes, buf.length);
client.close();
});
client.bind(0, () => client.send(buf, client.address().port, onMessage));
|