summaryrefslogtreecommitdiff
path: root/test/parallel/test-dgram-bytes-length.js
blob: 07a8bb0e43452bf4cc727d004bb7c7f6000ba20b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
require('../common');
const assert = require('assert');
const dgram = require('dgram');

const message = Buffer.from('Some bytes');
const client = dgram.createSocket('udp4');
client.send(
  message,
  0,
  message.length,
  41234,
  'localhost',
  function(err, bytes) {
    assert.strictEqual(bytes, message.length);
    client.close();
  }
);