mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 08:19:38 +01:00
3e1b1dd4a9
The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
18 lines
595 B
JavaScript
18 lines
595 B
JavaScript
var common = require('../common');
|
|
var assert = require('assert');
|
|
var dgram = require('dgram');
|
|
|
|
// Send a too big datagram. The destination doesn't matter because it's
|
|
// not supposed to get sent out anyway.
|
|
var buf = Buffer(256 * 1024);
|
|
var sock = dgram.createSocket('udp4');
|
|
sock.send(buf, 0, buf.length, 12345, '127.0.0.1', common.mustCall(cb));
|
|
function cb(err) {
|
|
assert(err instanceof Error);
|
|
assert.equal(err.code, 'EMSGSIZE');
|
|
assert.equal(err.address, '127.0.0.1');
|
|
assert.equal(err.port, 12345);
|
|
assert.equal(err.message, 'send EMSGSIZE 127.0.0.1:12345');
|
|
sock.close();
|
|
}
|