-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #9926 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information
1 parent
8e27254
commit 2e36b2e
Showing
2 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
'use strict'; | ||
var common = require('../common'); | ||
var assert = require('assert'); | ||
var dgram = require('dgram'); | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const 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.allocUnsafe(256 * 1024); | ||
var sock = dgram.createSocket('udp4'); | ||
const buf = Buffer.allocUnsafe(256 * 1024); | ||
const 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'); | ||
assert.strictEqual(err.code, 'EMSGSIZE'); | ||
assert.strictEqual(err.address, '127.0.0.1'); | ||
assert.strictEqual(err.port, 12345); | ||
assert.strictEqual(err.message, 'send EMSGSIZE 127.0.0.1:12345'); | ||
sock.close(); | ||
} |